btCollisionShape not updated when moving btCollisionObject

tunnuz
Posts: 11
Joined: Wed Dec 01, 2010 8:37 am

btCollisionShape not updated when moving btCollisionObject

Post by tunnuz »

Hello, I am trying to manually update the position of a btCollisionObject in my btCollisionWorld. I am proceeding as follows:

Code: Select all

mObject->setWorldTransform( btTransform(orientation, origin ));
mObject->activate(true);
I would expect the attached btCollisionShape to change its position together with the btCollisionObject, however when I ask Bullet an axis-aligned bounding box in world space:

Code: Select all

mObject->getCollisionShape()->getAabb()->(identity, min, max);
I always get the bounding box relative to the initial position of the object, rather than the newest. I have tried calling:

Code: Select all

physicalWorld->updateAabbs();
physicalWorld->updateSingleAabb(mObject);
But without any luck. Is there something I am missing?

Thank you
Tunnuz
fido
Posts: 14
Joined: Sun Mar 22, 2009 5:57 pm

Re: btCollisionShape not updated when moving btCollisionObje

Post by fido »

btCollisionShape is instanced object. One shape can be referenced by many collision objects.
That's why there is btTransform parameter in getAabb method. You should pass transform
of your body there.
tunnuz
Posts: 11
Joined: Wed Dec 01, 2010 8:37 am

Re: btCollisionShape not updated when moving btCollisionObje

Post by tunnuz »

Thank you, this was very helpful! In your information there is some limit on the motion of triangle meshes?