[ODE] Null Pointer...

Michael Lacher michael.lacher at hlw.co.at
Mon Jun 16 11:18:01 2003


Marco Vienup wrote:
> Hi,
> if a use:
> 
> geomB=dCreatePlane(space, a, b, c, d); 
> 
> const dBodyID b2=dGeomGetBody(geomB);
> 
> I become a null Pointer...? Can someone explain it ?
> 
dCreatePlane doesn't create any bodys, it only creates a plane collider. 
You will need to use dCreateBody to create the body, then attach it to a 
  collider if you want collision detection for that body. Physical 
simulation and collision detection are two seperate things in ODE. You 
can have one without the other if you want to.

NOTE: I am not sure what you try to do, but using a plane as collision 
geometry for a body seems to be wrong nonetheless. A plane in ODE is 
actually a halfspace, meaning that it actually covers an infinite volume 
(extends infinitely along the planesurface, and everything "below" the 
plane). To model the physical behavior of a plane correctly one would 
need a body with infinite mass, which is not possible. If you want a 
floor or wall that reacts to collisions you might be better off using a 
Box as collision geometry.

Mucki