Ellipsoids

User avatar
tasora
Posts: 26
Joined: Mon Aug 15, 2005 8:57 am
Location: Italy

Ellipsoids

Post by tasora »

Hallo,
is there any way to use *ellipsoids* as colliding shapes?

I just tried to use the 'sphere' collision shape, by using a non
uniform transformation matrix, but this does not work. In fact,
in the header file of btSphereCollisionShape I read that the
non-uniform scaling isn't supported anymore.

Does this mean that I should implement a custom inherited
class, or do I miss something?

regards,

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

Re: Ellipsoids

Post by Erwin Coumans »

Yes, to create an ellipsoid you can use the btMultiSphereShape with just one sphere and set the non-uniform scaling on that shape, using setLocalScale(...).

You can also make a capsule with this btMultiSphereShape, by adding two spheres, it will automatically use the convex-hull of all spheres.

Erwin

PS: the btSphereShape has the non-uniform scaling removed to improve performance, this is an internal optimization: the full radius can be used as 'gjk margin' which means less expensive 'penetration' depth calculation using ordinaty gjk instead of epa.



tasora wrote:Hallo,
is there any way to use *ellipsoids* as colliding shapes?

I just tried to use the 'sphere' collision shape, by using a non
uniform transformation matrix, but this does not work. In fact,
in the header file of btSphereCollisionShape I read that the
non-uniform scaling isn't supported anymore.

Does this mean that I should implement a custom inherited
class, or do I miss something?

regards,

Alessandro
User avatar
tasora
Posts: 26
Joined: Mon Aug 15, 2005 8:57 am
Location: Italy

Post by tasora »

Thank Erwin!

I forgot to make experiments with the btMultiSphereShape ..
Of course, the optimization for the 'uniform scaling' case of
simple sphere makes sense to me..

best regards

A.Tasora