Robot Simulator of the Robotics Group for Self-Organization of Control  0.8.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
ODE-Robots Collision handling

Since version 0.4 the collision handling was redesigned significantly.

It has the following features:

  • Material properties for each object (Substance)
  • No user specific collision code necessary
  • Automatic ignorance of collisions between connected bodies
  • User defined ignorance pairs
  • fine grain callback functions on collisions possible (Substance)
How to set material properties
Modify Substance in your local OdeHandle, e.g.
odeHandle.substance.toRubber(20);
// create Primitive with odeHandle
Primitive* box = new Box(1,1,1);
box->init(odeHandle, ...);
would change the substance to a soft rubber. Once you have created a Primitive you can change its properties in the same way:
box.substance.toMetal(0.6);
How to disable collisions between two primitives
odeHandle.addIgnoredPair(p1,p2);
// and to remove
odeHandle.removeIgnoredPair(p1,p2);
This mechanism is used internally for primitives that are connected by joints. So in most cases you don't have to worry about that.
How to disable collisions within an entire space
When you create the space with
  odeHandle.createNewSimpleSpace(parentspace,true/false);
you can set the flag to true to ignore all internal collisions. Alternatively you can change this for an existing space with:
odeHandle.addIgnoredSpace(spaceID);
// and to remove
odeHandle.removeIgnoredSpace(spaceID);