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

rod kay rodkay at dodo.com.au
Thu Oct 19 01:40:23 MST 2006


On Thursday 19 October 2006 17:55, rod kay wrote:

>    Unless I have made another blunder, the code should read ...

   Which indeed I did.

   Thirds times a charm (and sorry for the wasted b/w) ...


----------------------------------------------------------------------------------


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);
      body->world->nb--;
    }

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

  body->world = world;
}


More information about the ODE mailing list