Role of radius, half-extents, and local scaling

User avatar
dphil
Posts: 237
Joined: Tue Jun 29, 2010 10:27 pm

Role of radius, half-extents, and local scaling

Post by dphil »

btSphereShape allows you to set both a radius and a local scaling, so I imagine the effective size of the sphere is [radius*localScale.x, radius*localScale.y, radius*localScale.z]. Other shapes I have looked do not seem to have base size fields. So the sphere can be resized via both setLocalScaling(btVector3*) and setUnscaledRadius(btScalar), while other collision shapes are only resized (after being instantiated with size param's in the constructor) using setLocalScaling? If so, why is the sphere special, having its own modifiable radius in addition to the scaling and, for example, btBoxShape has no "setUnscaledHalfExtents" function? I just want to make sure I understand how collision shape resizing works (or is intended to work).

Thanks,
Dave