[ODE] Is it possible to Scale a given Inertia-Matrix?
GARY VANSICKLE
g.r.vansickle at worldnet.att.net
Wed Jun 16 21:49:33 MST 2004
> We do it for sphere, boxes & CCyls... Works a treat... Especially good
> for games, where sending the player object spinning too fast really
> reduces playability. Just scale the tensor, and the object will rotate
> less ;-)
>
> Here's our code:
> dMass m;
> // set inertia tensor
> switch (m_TensorType) {
> case kBoxTensor:
> m.setBox (1, m_Size.x, m_Size.y, m_Size.z);
> break;
> case kSphereTensor:
> m.setSphere (1, m_Size.x);
> break;
> case kCylinderTensor:
> m.setCappedCylinder (1, 0, m_Size.x, m_Size.y);
> break;
> }
> dMassAdjust (&m, m_Mass);
> dBodySetMass (m_Body, &m);
>
You're not scaling the size of the object though, that's what the OP was
talking about. Density is a power-one term of the inertia tensor integral,
so scaling density (i.e. mass) is a simple multiplication and is generally
applicable.
--
Gary R. Van Sickle
More information about the ODE
mailing list