Re[2]: [ODE] a bug in dBodyDestroy

slipch slipch <slipch at gsc-game.kiev.ua>
Wed Mar 19 05:35:02 2003


Hello Russ,

Wednesday, March 19, 2003, 7:15:52 AM, you wrote:





RS> here is my solution:

RS> void dBodyDestroy (dxBody *b)
RS> {
RS>   ...
RS>   // all geoms that link to this body must be notified that the body is
RS>   // about to disappear. note that the call to dGeomSetBody(geom,0) will
RS>   // result in dGeomGetBodyNext() returning 0 for the body, so we must
RS>   // get the next body before setting the body to 0.
RS>   dxGeom *next_geom = 0;
RS>   for (dxGeom *geom = b->geom; geom; geom = next_geom) {
RS>     next_geom = dGeomGetBodyNext (geom);
RS>     dGeomSetBody (geom,0);
RS>   }
RS>   ...
RS> }

RS> does this work for you konstantin/david ?

RS> russ.

Thank you for the reply.
I use the same solution (see the thread).
It does work for me.


-- 
Best regards,
 Konstantin Slipchenko                            mailto:slipch@gsc-game.kiev.ua