This patch contains the following ODEDynamics improvements:
1) Method for removing objects from ODE simulation (they are still
rendered, but they don't interact any more with other bodies)
2) Quick access to a body manipulator using the 'manip' field.
After adding a body to ODEDynamics, it receives a new field, 'manip'.
Therefore, it is much easier to manipulate objects.
s = Sphere()
odeSim = ODEDynamics()
# now 's' has a 'manip' field:
A small inconvenience is that every object present in the simulation
also has a corresponding ODEBodyManipulator allocated. This can be
optimized by implementing 'manip' as a property and create the
ODEBodyManipulator only when user code actually tries to use the
However, I did some profiling and did not notice any decrease in
performance. My simulation had 10-20 boxes and 5 trimeshes.
3) Access to ODE geoms using the 'odegeoms' property in ODEBodyManipulator.
Before, I wanted to change the collide bits during simulation, and this
wasn't easy since the ODE geoms were hidden.
4) Use default mass = 1 for objects without mass set
(Before, adding an object without mass to the simulation resulted
in ODE crash)
5) Collision events between a pair of bodies with materials (mat1,mat2)
and contact properties set always occurs in the same order (1,2)
* contact normal is always in the same direction (deterministic)
* Fdir1 is always in the same direction => it is possible to simulate
a conveyor belt.
Before, the order in which the two bodies appeared in the collision
event was undefined, resulting in Fdir1 always changing its sign
randomly (and also the direction of the conveyor belt).
6) ODEBodyManipulator automatically wakes up (enables) the associate body
when using setPos, setRot, setLinearVel, setAngularVel, addForce or
Before, if one used AutoDisable flag for performance reasons, a call
to e.g. addForce did not move a stationary body, because it was
automatically disabled by ODE.
Now, the body wakes up automatically upon manipulation.
7) fixed ODEBodyManipulator.setRot
(it didn't accept a mat3 argument, since PyODE wanted a list).
Now it can also accept a list in row-major order.
8) Added ODEFixedJoint class.
It is useful for modeling complex rigid bodies with different contact
properties on different sides.
I have used this to simulate a pen which can draw on paper with its tip,
and also can be manipulated (grasped) from its body. Therefore, the pen
is made of two "glued" objects: one which has friction and can be
grasped (the pen body), and other (the ballpoint tip) which has mu=0
between itself and Paper object.
9) Documented the above changes, added some of my observations on the
way ODEDynamics works, and also added some links to the new ODE wiki.