Adobe ATMOSPHERE User Manual page 251

Table of Contents

Advertisement

239
ADOBE ATMOSPHERE
User Guide
Physical Models
An object will only be animated using physics when a "physical model" has been created to control it. Each frame,
the physical model updates the position and orientation of the object for which it was created. Physical models have
position, orientation, velocity, angular velocity, and acceleration. They also have fl ags that determine whether they are
fi xed in space, and whether they will collide with other physical models. Collisions may be disabled between pairs of
physical models as needed to permit intersections which are part of the design.
For reasons of effi ciency, there are two kinds of physical models "convex" and "concave". Convex physical models are
approximated using the convex hull of their geometry and they simulate collisions effi ciently. "Concave" physical
models are slower, but allow objects to enter within the convex hull of each other to compute more accurate
collisions. An exception to this rule occurs when a physical model is created with a mass of zero. In such a case, the
physical model is locked to the world, and a concave physical model is just as effi cient as a convex. This is especially
useful when using a Viewpoint object to represent a terrain surface or part of a fi xed structure (such as a slide).
Making a terrain object convex would prevent other physical models from moving into the valleys. Making it concave
is still effi cient, since the physical model has zero mass and so is locked in place.
To create a physical model, a function such as createPhysicalModel(mass, inertiaScale) is called, and may be used
with a scene group, a Viewpoint object, a Viewpoint instance, a surface object or a solid object. When createPhys
icalModel(mass, inertiaScale) is called for a scene group, any Viewpoint objects, surface objects and solid objects
contained within the scene group are unioned together into one physical entity (note that this does not include child
scene groups). There is a fl ag which prevents the union with a parent scene group's physical model, and this fl ag is
automatically set to "true" if an object within the scene group has already been used to create a physical model. Child
scene groups will be kinematically placed relative to the parent every frame, but will not interact physically.
The user interface for the Adobe Atmosphere Player application includes check boxes for "Collisions" and "Gravity".
Note that these settings actually only control whether the "Actor" experiences gravity and collisions. To enable gravity
for a physical model, the physical model must have its vertical acceleration set to a Vector (such as Vector( 0, -32, 0
) for Earths' gravity at sea level). This enables gravity to be controlled independently for different objects. A hot air
balloon, for example, might have the acceleration for its canopy set to point upwards, simulating lift.
Physical Constraints
A constraint object, in the physics engine, is a way to restrict the motion of two physical objects in such a way that
there appears to be a type of mechanism connecting them. For instance, a point-to-point constraint requires that a
point on one physical object remain in the same position as a second point on a second physical object, no matter
how one or both of them moves. In this way the effect of a spherical joint may be added to the simulation. Hinges
(using a "hinge constraint") and rails (a "prismatic constraint") may also be created. Constraints need to be "solved"
or enforced, using a fast constraint solver object. One of these objects is created in the script, and the constraints
are set using a specifi ed solver. "Angular Dashpots" are not constraints as such, but may be used as damped angular
springs to encourage the relative orientation of one object to another, such as a spring-loaded door.

Advertisement

Table of Contents
loading

Table of Contents