getting this "out of body experience", see pic?
Beside deleting and recreating the static object which obviously works, tried removing, updating the world transform and adding back the rigid
body/collision shape, even getting the object dynamic, then static again.
Only the world transform seems to remain the same, so when I query it, it renders under the collusion shape.
Any ideas, please? Thank you! ))
Code: Select all
m_dynamicsWorld->removeRigidBody(rigidBody); btTransform transform; transform.setIdentity(); transform.setOrigin(btVector3(positionObject.x(), heightTerrain, positionObject.z())); transform.setRotation(rigidBody->getWorldTransform().getRotation()); rigidBody->setWorldTransform(transform); m_dynamicsWorld->addRigidBody(rigidBody);