Can't drive btCollisionObject from btMotionState?
Posted: Thu Aug 18, 2011 3:57 pm
Hi -- I'm using Bullet for collision detection only, so I'm linking with just libBulletCollision and not using btRigidBody. I'm also visualizing the btCollisionObjects (with OSG).
I've discovered that there is no clean way to update the world transform of a btCollisionObject and also keep the graphics in sync, because btCollisionObject doesn't support btMotionState. This seems odd to me, because btMotionState is part of libBulletLinearMath, so it could be used/supported by btCollisionObject. However, it appears that btRigidBody is the only class that supports btMotionState to keep graphics in sync.
As a workaround, I currently set the world transform of both the btCollisionObject and the visual representation of that object. This works fine, but ideally it'd be cleaner to be able to use a btMotionState to keep these in sync and just set the world transform once.
Is there a reason why btCollisionObject doesn't support btMotionState?
I could probably modify Bullet to make this work, but wanted to start a discussion before I started the code dev. It seems like I'd just need to move the setMotionState member fundtion (and associated variable) to btCollisionObject, and let btRigidBody inherit them. Seems like that's about all that is needed, but there might be more.
Thoughts? Should I give it a try and post a patch to googlecode?
I've discovered that there is no clean way to update the world transform of a btCollisionObject and also keep the graphics in sync, because btCollisionObject doesn't support btMotionState. This seems odd to me, because btMotionState is part of libBulletLinearMath, so it could be used/supported by btCollisionObject. However, it appears that btRigidBody is the only class that supports btMotionState to keep graphics in sync.
As a workaround, I currently set the world transform of both the btCollisionObject and the visual representation of that object. This works fine, but ideally it'd be cleaner to be able to use a btMotionState to keep these in sync and just set the world transform once.
Is there a reason why btCollisionObject doesn't support btMotionState?
I could probably modify Bullet to make this work, but wanted to start a discussion before I started the code dev. It seems like I'd just need to move the setMotionState member fundtion (and associated variable) to btCollisionObject, and let btRigidBody inherit them. Seems like that's about all that is needed, but there might be more.
Thoughts? Should I give it a try and post a patch to googlecode?