The jit.phys.world object encapsulates a physics simulation context to perform collision detection and rigid body dynamics on its child objects. Other physics objects in the same patch as a jit.phys.world object are automatically added to the world. Multiple contexts can be managed by explicitly setting the name attribute of the jit.phys.world object and the worldname attribute of the child physics objects. Dynamics can be disabled, allowing the world to be used solely for collision detections. A 2D simulation is achieved with the remove_plane attribute.
The physics engine maintains an internal timer for simulation steps that decouples the physics step frequency from the rendering frame rate. The fixedtimestep attribute controls the physics engine frequency, and the maxsubsteps attribute clamps the number of steps allowed between updates. The default frequency of 60 and maxsubsteps of 1 requires a FPS of 60. If the FPS is 30, maxsubsteps should be increased (allowing for more than 1 simulation step each update). If the simulation is behaving incorrectly (rigid body penetration, erratic movement, etc), try increasing the simulation frequency and sub-steps.
Enables and disables automatic mode where update messages are received from that target jit.gl.render object (default = 1).
Specifies the format of the collisions dictionary (default = simple)
'simple' ( Report contact point positions and normals average )
'complete' ( All contact point position and normals reported )
Enables and disables collision reporting out the second (dumpout) outlet.
Assign to the named drawing context, allowing for updates to be received automatically.
Enables and disables rigid-body dynamics.
Enable the physics simulation for all objects in this physics context (default = 1).
Fixed time step value (Hz) of physics simulation (default = 60). Increasing this value increases the resolution of the simulation.
gravity [3 floats]
A 3D vector describes the force of gravity applied to all objects in the world (default = 0, -9.8, 0).
Maximum number of internal simulation steps between updates (default = 1). Increase this number if FPS is low in order to prevent the simulation from losing time.
Specifies the name of the instance (default = UID).
Specifies the number of collision points in the world.
Sets the number of collison dispatcher threads (default = 1). Increasing the number of threads may improve performance, especially for physics scenes with distinct and separate groups of colliding objects.
Specifies how raytest messages return object hits for the
'closest' ( Return only the object closest to the camera )
'all' ( Return all intersecting objects )
Remove plane to enable 2D simulation (default = none).
0 = 'none'
1 = 'x' ( Constrain simulation to Y and Z planes )
2 = 'y' ( Constrain simulation to X and Z planes )
3 = 'z' ( Constrain simulation to X and Y planes )
Enables and disables split impulse dynamics (default = 1). When enabled, split impulse will allow the dynamics solver to apply positional corrections when deep collision penetrations occur.
Specifies the name of a jit.gl.render object to receive update messages from.
Enables and disables the world bounds. (default = 1)
worldbox_scale [3 floats]
Changes the size and shape of the world bounds (default = 5, 5, 5).
Common Box Attributes
Sets the text that will be displayed in the Clue window when the user moves the mouse over the object.
background [int] (default: 0)
Adds or removes the object from the patcher's background layer.adds the object to the background layer, removes it. Objects in the background layer are shown behind all objects in the default foreground layer.
color [4 floats]
Sets the color for the object box outline.
Sets the type style used by the object. The options are:
bold italic Possible values:
0 = 'regular'
1 = 'bold'
2 = 'italic'
3 = 'bold italic'
Sets the object's font.
Sets the object's font size (in points).
hidden [int] (default: 0)
Toggles whether an object is hidden when the patcher is locked.
Sets the text that will be displayed in as a pop-up hint when the user moves the mouse over the object in a locked patcher.
ignoreclick [int] (default: 0)
Toggles whether an object ignores mouse clicks in a locked patcher.
JS Painter File
patching_rect [4 floats] (default: 0. 0. 100. 0.)
Sets the position and size of the object in the patcher window.
position [2 floats]
Sets the object's x and y position in both patching and presentation modes (if the object belongs to its patcher's presentation), leaving its size unchanged.
presentation [int] (default: 0)
Sets whether an object belongs to the patcher's presentation.
presentation_rect [4 floats] (default: 0. 0. 0. 0.)
Sets the x and y position and width and height of the object in the patcher's presentation, leaving its patching position unchanged.
rect [4 floats]
Sets the x and y position and width and height of the object in both patching and presentation modes (if the object belongs to its patcher's presentation).
size [2 floats]
Sets the object's width and height in both patching and presentation modes (if the object belongs to its patcher's presentation), leaving its position unchanged.
textcolor [4 floats]
Sets the color for the object's text in RGBA format.
Sets the justification for the object's text.
0 = 'left'
1 = 'center'
2 = 'right'
Sets the patcher's scripting name, which can be used to address the object by name in pattr, scripting messages to thispatcher, and the js object.
|jit.phys.body||A rigid body and collision shape|
|jit.phys.multiple||Uses matrices to simulate multiple rigid bodies|
|jit.phys.ghost||A collision sensor and forcefield|
|jit.phys.picker||Constraint picking in a physics world|
|jit.gl.physdraw||A physics opengl debug drawer|