Game Development Reference
In-Depth Information
be recomputed every time they are needed. Also, the inertia tensor,
being a rotation, is a constant only if it operates on vectors expressed
relative to the body axes of the rigid body. Relative to the world
axes, the inertia tensor varies continuously as the body rotates.
Sometimes the physics engine can store an offset of the center of
mass of the object (which, like the inertia tensor, is constant only
in the body space of the object). We noted earlier that for reasons
of numeric stability and simplicity, internally a physics engine might
prefer to assume the origin of the body space is its center of mass,
and this center of mass offset is taken into consideration in the client
interface routines.
Each body is associated with one or more collision geometry objects,
the union of which defines the shape of the rigid body, as discussed
below.
The second class of variables that define the state of the dynamics body
are those that evolve over time, and contain some “history” in them and
must be carried forward from one frame to the next. If we need to save the
complete state of the simulation and resume it later (for example, in a save
game), these variables cannot be derived from any other source and must
be serialized:
position,
orientation,
linear velocity,
angular velocity.
This list reflects a choice to make velocities the primary state variables,
in which case the momentums are easily derived quantities. An alternate
strategy is to use the momentum as the primary state variable and ve-
locity as the derived quantity. The former approach has an advantage in
dealing with kinematically controlled objects, whose inertia (and therefore
momentum) is considered infinite. The latter can more elegantly deal with
the situation in which the mass changes over time, since conservation of
momentum is automatically enforced.
Finally, each dynamics body has certain properties that are stored in
working variables. These quantities change over time but do not inherently
have “history” integrated into them. These sorts of variables are often reset
at some point within the simulation step. If we wanted to save the state of
Search WWH ::




Custom Search