开发者

Inertia must be positive definite

开发者 https://www.devze.com 2023-04-01 08:24 出处:网络
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

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 phy开发者_StackOverflow社区sics->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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号