Confused about localScaling

Volker
Posts: 5
Joined: Sat May 12, 2007 9:30 pm

Confused about localScaling

Post by Volker »

Does it make sense, that when I set the localScaling of a btConvexTriangleMeshShape it will store the scaling by calling m_stridingMesh->setScaling(scaling); but when I call getLocalScaling on the btConvexTriangleMeshShape I will get the member variable m_localScaling from the btConvexShape class?

In this case these values are not equal!
Volker
Posts: 5
Joined: Sat May 12, 2007 9:30 pm

Another confusion

Post by Volker »

Another curiosity is in btBvhTriangleMeshShape::setLocalScaling:

within this method btTriangleMeshShape::setLocalScaling is called which recalculates m_localAabbMin and m_localAabbMax. But after this recalculation these two variables are multiplicated with the given scaling again which results in a quadratic scaling, e.g. when specifying a scale of 3 the m_localAabbMin and -Max has a scale of 9.
Volker
Posts: 5
Joined: Sat May 12, 2007 9:30 pm

Post by Volker »

And again some confusion.

The getScaling of the btMatrix3x3 seems to return the squared scaling instead of the real scaling. Perhaps this should be mentioned in the documentation.
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Post by Erwin Coumans »

This local scaling issue will be fixed for convex and concave triangle meshes.
Note that not all shapes support local non-uniform scaling, in particar btSphereShape. If you want a non-uniform scaled sphere, you need to use btMultiSphereShape.

Scaling functionality should have been removed from transforms (btTransform) and this remainder will be removed from btMatrix3x3.

Thanks for the feedback!
Erwin