2

I am trying to connect two bodies (one static and one dynamic) using a spring in Bullet. I am using the btGeneric6DofSpringCOnstraint.

The dynamic body hangs from the static body.

During the simulation, I am changing the mass of the dynamic body:

btVector3 localInertia;
btb->getCollisionShape()->calculateLocalInertia(mass,localInertia);
btb->setMassProps(mass,localInertia);
btb->updateInertiaTensor();
//m_dynamicsWorld->addRigidBody(btb);
btb->activate(true);

However, no matter what mass I use, the body is still hanging at a same distance from the static body.

Any idea of why this is happening?

4

1 回答 1

0

我想约束没有使用新的质量属性,因为它没有被更新,并且缓存了一些内部预先计算的值。您应该搜索一种更新约束的方法,但抱歉我不知道是否有解决方案。

于 2014-05-19T20:06:04.727 回答