[ODE] Problem with ODE's internal assertions (or my code which I doubt)

Vast vasko.tim at gmail.com
Sun Nov 6 18:52:46 MST 2005


Hey everyone, I implemented ODE into my engine fine a couple of months ago,
but then I went into a rewrite, and now again I am stuck with
implementing/relearning the engine.

The problem is VERY strange now. Basically, here is my set up: I have a
class CPhysicsObject which has fields - dJointIDs, dBodyIDs, dGeomIDs, and a
dSpaceID. These fields (those were the types) are arrays (except for space)
and essentially hold data for my physics objects (which are entities that
inherit that class). Its all really simple. In that CPhysicsObject class I
have a setup method (not virtual since I dont need to overwrite it) which
sets things up such as allocating space for the fields I mentioned earlier
and stuff). Then (its just for now, for testing) I have right after those
allocations and things I create a body, then I assign position to it. Then I
create mass, and try to assign to it, but here is where things start to act
up, code:

void CPhysicsObject::SuperPhysicsCreate()
{
physSpace = dSimpleSpaceCreate(CPhysics::mainSpace);

physNumBodies = 1;
physBodies = new dBodyID [physNumBodies];
physBodies[0] = dBodyCreate(CPhysics::mainWorld);
dBodySetPosition(physBodies[0], 0, 15, 0);

dMass m;
* dMassSetBox (&m, 1, 3, 3, 5);*
dMassAdjust (&m, 50);

physNumGeoms = 1;
physGeoms = new dGeomID [physNumGeoms];
// physGeoms = dCreateSphere(0, 15);
// *physGeoms[0] = dCreateSphere(0, 15);*
* physGeoms[0] = dCreateBox(0, 3, 3, 5);*
}

These lines (red ones) cause assertions. It is VERY strange to say the
least. The CPhysics is initialized before any of this is executed (CPhysics
is a static class which has the near callback, world, and space fields, and
does all the stepping and stuff). I still cant understand why the assertions
are triggered. What they say is that one of the parameters is <= 0, such as
when i create the box (the mass stuff has to be commented out otherwise the
execution stops there and doesnt go to the geoms part) the assertion checks
whether the parameters (in this case 3, 3, 5) are zero or less, as you can
see they aren't but the assertion is triggered anyway. That does NOT happen
if I try to create a sphere (blue) the assertion there seems to be
completely satisfied with the parameter. I am using the latest stable
release, all samples compile and run fine, and its just here.

Any suggestions/experiences with similar things) are welcome and encouraged.

Thanks!

Regards,

Tim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://q12.org/pipermail/ode/attachments/20051106/c3228842/attachment-0001.htm


More information about the ODE mailing list