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

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


   Sorry, please ignore the superfluous ...

        if (body->world)

   ... in the code I sent before.


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


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


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

  body->world = world;
}


More information about the ODE mailing list