I'm writing a game in C++ using Open Dynamics Engine. When I run it, i get these errors:
ODE Message 2: inertia must be positive definite in dMassCheck() File ../../../../../ode/src/mass.cpp Line 53 ODE Message 2: inertia must be positive definite in dMassCheck() File ../../../../../ode/src/mass.cpp Line 53 ODE INTERNAL ERROR 1: assertion "dMassCheck(mass)" failed in dBodySetMass() [../../../../../ode/src/ode.cpp]
I have this code:
void Physics::addObject(dBodyID *body, dMass *massPtr, dReal mass) {
*body = dBodyCreate(world);
dMassSetSphereTotal(massPtr, 2.0f, 1.0f);
dBodySetMass(*body, massPtr);
dBodySetPosition(*body, 0.0, 0.0, 0.0);
}
I'm calling it by physics->addObject(&orb.body, &orb.mass, 1.0);
.
The massPtr
structure contains an inertia tensor. This tensor (just a matrix, in this context) has to be positive definite. That's all we can say until you tell us where you got your massPtr
from.