Adobe ATMOSPHERE User Manual page 307

Table of Contents

Advertisement

friction
The coeffi cient of friction for the physical model. Higher values of friction allow physical models to sit on slopes
without sliding. Typical values are in the range of 0.0 to 1.0, although higher values are allowed - negative values
are not. The defi nition of friction is the ratio between the normal force and the largest allowed lateral friction
force that may result. Coeffi cients of friction are combined for two physical models to come up with a single
value for interactions between them.
// See 'fi xed' code sample above for example
intertiaScale
This value scales the moment of inertia of the physical model as it is created. The default value is 1.0. Values
larger than 1.0 may be required to aid the stability of long chains of physical models linked together by
constraints.
// See 'fi xed' code sample above for example
restitution
This coeffi cient affects the degree of bounce of an object. Allowed values are between 0.0 (no bounce) and
1.0 (perfect bounce). It is defi ned as the ratio of velocities before and after a normal collision to a surface.
Coeffi cients of restitution are combined for colliding physical objects to come up with a single value for
interactions between them.
// See 'fi xed' code sample above for example
useForOverlaps
A fl ag specifying whether this physical model should be considered when processing an OverlapEventHandler().
box1.physicalModel.useForOverlaps = true;
Methods
applyAngularImpulse(Vector impulse)
This function increments the angular momentum of the physical model by a specifi ed amount. The direction of
the impulse vector defi nes the rotation axis, and the magnitude of the vector determines the amount of angular
momentum applied. A torque impulse may be thought of as a large torque applied for a short time, with the
magnitude of the torque being multiplied by the duration to get the amount of angular momentum change.
box = SceneGroup("./box.aer").add();
box.timestep = function()
{
if (this.loaded)
{
this.physicalModel = this.createPhysicalModel(10);
this.physicalModel.collide = true;
this.root = this.getSolidObject(0).rootPrimitive;
this.root.onClick = function()
{
295
ADOBE ATMOSPHERE
User Guide

Advertisement

Table of Contents
loading

Table of Contents