btMultiSphereShape question

rcharlton
Posts: 6
Joined: Wed Jun 10, 2009 1:36 pm

btMultiSphereShape question

Post by rcharlton »

I'm using btMultiSphereShape to create a chamfer box. (Note that I've had to increase MAX_NUM_SPHERES from 5 to 8 to do this). However its constructor is as follows:

Code: Select all

btMultiSphereShape (const btVector3 &inertiaHalfExtents, const btVector3 *positions, const btScalar *radi, int numSpheres)
Please can someone tell me what inertiaHalfExtents represents?

Thanks!
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: btMultiSphereShape question

Post by Erwin Coumans »

Thanks for the feedback.

Can you please upgrade to Bullet 2.75 RC3 (or later) from http://code.google.com/p/bullet/downloads/list?
It allows arbitrary number of spheres, and we removed the inertiaHalfExtents argument.
(inertiaHalfExtents was the half extents of a local axis aligned bounding box around all spheres, used to approximates the inertia tensor)

If you want more accurate inertia tensor, it is best to use a bt
CompoundShape, adding btSphereShape child shapes, and use the btCompoundShape::calculatePrincipalAxisTransform to shift the the spheres so that the center of mass & prinicple axis of inertia match the rigid body local transform. See BasicDemo attachment in
http://bulletphysics.com/Bullet/phpBB3/ ... 67&start=2

Thanks,
Erwin
rcharlton
Posts: 6
Joined: Wed Jun 10, 2009 1:36 pm

Re: btMultiSphereShape question

Post by rcharlton »

OK.

Many thanks for the quick answer!