Simple question about position/orientation

devrichard
Posts: 2
Joined: Sun Jul 27, 2008 8:41 am

Simple question about position/orientation

Post by devrichard »

Hi,

I've managed to setup a ground plane and some rigidbody boxes by following the ccd demo, but I would like to draw the objects myself (ie not using the opengl drawer in the ccd demo). Is there a simple way to access the position and orientation of my boxes?
Is it something like m_collisionShapes.getPosition() ?

Thanks
devrichard
Posts: 2
Joined: Sun Jul 27, 2008 8:41 am

Re: Simple question about position/orientation

Post by devrichard »

ahhh ok I understand now, you have to use m_dynamicsWorld->getCollisionWorld()->getCollisionObjectArray(), then upcast to rigidbody and get its transform.
PaulMartz
Posts: 28
Joined: Mon Jun 02, 2008 7:21 pm

Re: Simple question about position/orientation

Post by PaulMartz »

In my code, I derive a class from btDefaultMotionState and override the setWorldTransform() method. Bullet calls that method to update the position/orientation of the rigid body.

Hope that helps.
-Paul