Hello Bullet community,
the btRigidBody class provides only one method to change the position of the body:
Code: Select all
void btRigidBody::translate(const btVector3& v)
{
m_worldTransform.getOrigin() += v;
}
However, I need a btRigidBody::setPosition that would basically do:
Code: Select all
void btRigidBody::setPosition(const btVector3& v)
{
m_worldTransform.setOrigin(v);
}
"Why?" you may ask. Well, I programmed a terrain that consists of smaller pieces, so called chunks, each of them uses a btRigidBody. Within each frame all those chunks will be repositioned in relation to the camera position to keep them near the origin. Chunks out of a certain range will be unloaded and new chunks will be loaded. This way I am able to have infinite terrain. If you know
Minecraft you might know what I mean. The point is that the repositioning of the chunks' btRigidBodies via
translate could cause some floating point inaccuraccies over time. Whereas with a call for btRigidBody::setPosition I would be able to avoid those problems.
Is there a chance that the devs add such a method to bullet?
Greetings
BrightBit