8.8 ODEDynamics -- Rigid body dynamics using the Open Dynamics Engine

class ODEDynamics( name = "ODEDynamics",
gravity = 9.81,
substeps = 1,
enabled = True,
erp = None,
cfm = None,
defaultcontactproperties = None,
collision_events = False,
auto_add = False,
show_contacts = False,
contactmarkersize = 0.1,
contactnormalsize = 1.0,
auto_insert = True
)

gravity is the acceleration due to gravity. The direction of the acceleration is in negative "up" direction (as specified by the scene).

substeps is the number of simulation steps per frame. You can increase this value to get a more accurate/stable simulation.

The simulation will only run if enabled is True, otherwise it's halted.

erp and cfm are the global error reduction parameter and constraint force mixing value to be useed (see the ODE manual).

defaultcontactproperties is a ODEContactProperties object that specifies the default contact parameters. These parameters are used for contacts between two objects (resp. materials) that have not been set explicitly using setContactProperties().

collision_events determines whether the component will generate ODE_COLLISION events whenever a collision has occured. An event handler takes a ODECollisionEvent (see section 8.8.3) object as argument.

If auto_add is True the component searches the scene for rigid bodies and hinges and adds them automatically to the component. This is done at the time the component is created, so any bodies or hinges created afterwards will be ignored.

show_contacts determines whether the contact points and normals are visualized or not (this is mainly for debugging purposes). The size of the contact point markers and the length of the normals can be specified via the contactmarkersize and contactnormalsize arguments.

add( objects, categorybits=None, collidebits=None)
Add world objects to the simulation. objects can be a single object or a sequence of objects. An object may be specified by its name or the object itself. categorybits and collidebits are long values that control which objects can collide with which other object. The specified category and collide bits are assigned to every object in objects. Each bit in categorybits represents one category the objects belong to. collidebits is another bit field that specifies with which categories the objects may collide. By default, every bit is set in both values.

reset( )
Reset the state of the simulated bodies. All bodies will be set to the position and velocity they had when they were added to the simulation. This method is also called when the RESET event is issued.

setContactProperties( (mat1, mat2), props)
Set the contact properties for a material pair. mat1 and mat2 are two Material objects and props is a ODEContactProperties object describing the contact properties.

getContactProperties( (mat1, mat2))
Return the contact properties for a material pair. The order of the materials is irrelevant. The return value is a ODEContactProperties object. A default property object is returned if the pair does not have any properties set.

createBodyManipulator( object)
Return an ODEBodyManipulator object that can be used to apply external forces/torques to the world object object.

Note: To use the ODEDynamics component the PyODE module has to be installed on your system which wraps the Open Dynamics Engine.



Subsections