[ODE] ode crashing at loadtime

Nate W coding at natew.com
Sun Feb 22 02:08:31 MST 2004


On Sun, 22 Feb 2004, Fabian Mathews wrote:

> i have no physics objects.... ODE crashes when i call dWorldStep(world, 
> 1.0f);

1.0 is a really large value for dWorldStep.  Most of us are using
the elapsed time in seconds - 0.05 is a pretty big step, and 0.01 or
less is better.

> void PhysicsMgr::Update( unsigned long tick )
> {
> 	dSpaceCollide( space, 0, &nearCollisionCallback );
> 
> 	dWorldStep(world, 1.0f); //CRASHES HERE!!!!!
> 	dJointGroupEmpty(contactgroup);
> }

A better elapsed-time parameter might help, but I'm not promising.  In any
case, this would probably be easier to diagnose if you could tell us where
in dWorldStep the crash is occurring, and what kind of crash this is.  Is
it a null reference, a divide-by-zero, a bad (but not null) pointer, or
what?  Where do the bad values come from?  You have the source, we have
the source, let's get some more detail. :-)

> PhysicsObj::PhysicsObj()
> {
> 	body = dBodyCreate( PhysicsMgr::GetInstance().GetWorld() );
> 	printf("NEW PHYS OBJ\n");
> 	dBodySetLinearVel(body, 3, 5, 1);
> 	geom = dCreateSphere( PhysicsMgr::GetInstance().GetSpace(), 35 ); //CRASHES 
> 	dGeomSetBody( geom, body );
> 	SetSpace( PhysicsMgr::GetInstance().GetSpace() );
> }

Compare the return value of dCreateXxxxSpace with the return value of
GetSpace().  I know they're supposed to be the same, but I still think
it's worth stepping through the last part of dCreateXxxxSpace and the
first part of dCreateSphere, and comparing the values, just to be sure.  I
can't think what else would cause this.

-- 

Nate Waddoups
Redmond WA USA
http://www.natew.com/




More information about the ODE mailing list