[ODE] creating bodies, joints and geoms with 'null' world/space arguments

rod kay rodkay at dodo.com.au
Thu Oct 19 00:07:00 MST 2006


On Thursday 19 October 2006 08:58, Jon Watte (ODE) wrote:
> What happens if I call dBodySetWorld() on a body that is already in
> another world?
>



   At the moment, the body is taken out of the first world and placed in the 
new. Here is the code ...



void dBodySetWorld (dxBody *body,  dxWorld* world)
{
  dAASSERT (body);

  if (body->world == 0  &&  world == 0)
    return;


  if (world)
  {
    if (body->world)   // remove from current world.
    {
      removeObjectFromList (body);
      if (body->world)
        body->world->nb--;
    }

    addObjectToList (body,  (dObject **) &world->firstbody);
    world->nb++;
  }
  else
  {
    removeObjectFromList (body);
    if (body->world)
      body->world->nb--;
  }

  body->world = world;
}




regards.


More information about the ODE mailing list