Ghost object and scale

Post Reply
Ezzat
Posts: 1
Joined: Tue Jun 26, 2012 1:45 pm

Ghost object and scale

Post by Ezzat » Tue Jun 26, 2012 1:58 pm

Hi all,

I am playing with jbullet, which is bullet 2.72 java port.

I have a character which is moved thanks to a ghost object.
To get the character collision shape as a BoxShape, i compute the local bounding box of the character mesh and then create the BoxShape with the half of the extent of my bounding box.

My problem comes when i apply an uniform scale on the mesh, in that case, the BoxShape should be scaled too.
How can i say to bullet to apply a scale over the BoxShape to get correct collisions ?

If i scale manualy the half extent given to the BoxShape, it works but it should not be the proper way to achieve that.
How to manage the case when the scale of the object change dynamically ?

Thanks for your attention,
Regards,
Ezzat

Post Reply