User Guide

ADOBE ATMOSPHERE 371
User Guide
Properties
tau
The time constant for the constraint, similar to damping.
strength
The strength or stiffness of the constraint.
relativeOrientation
The orientation of the axis of constraint relative to the fi rst PhysicalModel.
relativeTranslation
The translation of the axis of constraint relative to the fi rst PhysicalModel.
slideDirection
The Vector representing the direction of motion to which the PhysicalModels will be constrained.
Code Sample
ring = SceneGroup(“./ring.aer”).add();
pole = SceneGroup(“./pole.aer”).add();
loader = new Object();
loader.timestep = function()
{
if (ring.loaded && pole.loaded)
{
ring.physicalModel = ring.createPhysicalModel(1);
pole.physicalModel = pole.createPhysicalModel(10);
solver = FastConstraintSolver();
constraint = solver.createPrismaticConstraint(ring.physicalModel, pole.physicalModel);
constraint.strength = 1.0;
constraint.tau = 1.0;
constraint.relativeOrientation = Rotation(‘Z’, 1.0);
constraint.relativeTranslation = Vector(1.0, 2.0, 3.0);
constraint.slideDirection = Vector(0.0, 1.0, 0.0);
removeAnimator(this);
}
}
addAnimator(loader);
StiffSpringConstraint
A stiff spring constraint between two physical models constrains two points on those bodies to remain at a specifi ed
distance from each other not matter what other physical motion they may experience. The constraint is created using
a fast constraint solver and may be thought of as a stiff physical spring.