[ODE] vanishing objects and clearing all objects
Thomas Grimes
striiideerr at hotmail.com
Mon Aug 4 19:17:02 2003
I have made a simple ODE demo that does the same thing as the box dropping
demo that comes with the ODE source. Well for some odd reason mine is having
issues. For one, when I made my demo let me drop more than one box at once I
noticed that sometimes, not always, a small group of my boxes will just
vanish! Now I have my program setup so that you can't drop more than 10
boxes and if you try to it does nothing, it wont execute the code that
creates new boxes and such. What would cause some of the objects to just
vanish?
Also, I have an option that when I hit the 'c' key, all of the boxes get
cleared so I can drop some more. Here is what that part looks like:
if( KEYDOWN( buffer, DIK_C ) && !KEYDOWN( oldbuff, DIK_C ) ) // Clear the
box (C key)
{
for( int i = 0; i < obj_num; ++i )
{
dBodyDestroy( g_obj[i].body );
dGeomDestroy( g_obj[i].geom[0] );
memset( &g_obj[i], 0, sizeof( g_obj[i] ) );
t = next_obj = obj_num = 0;
}
dropped = false;
}
Ok after I do this all boxes are gone. But when I start dropping more boxes,
it's like those old boxes still exist in the world and my new ones will
bounce or sit on the old but invisible boxes. Why would it be doing that?
When I hit 'c' I want all box objects I created to be gone completely and
not leave their "ghost" in the world. Thanks.
_________________________________________________________________
The new MSN 8: smart spam protection and 2 months FREE*
http://join.msn.com/?page=features/junkmail