Prismaticconstraint - Adobe ATMOSPHERE User Manual

Table of Contents

Advertisement

370
APPENDIX E
tau
The time constant for the constraint, similar to damping.
Methods
setWorldSpacePivotPoint(Vector pivot)
The point in world space that defi nes the location of the constraint.
Code Sample
cube = SceneGroup("./cube.aer").add();
star = SceneGroup("./star.aer").add();
loader = new Object();
loader.timestep = function()
{
if (cube.loaded && star.loaded)
{
cube.physicalModel = cube.createPhysicalModel(1);
star.physicalModel = star.createPhysicalModel(10);
solver = FastConstraintSolver();
constraint = solver.createPointToPointConstraint(cube.physicalModel,
constraint.strength
constraint.tau
pivot
constraint.setWorldSpacePivotPoint(pivot);
removeAnimator(this);
}
}
addAnimator(loader);

PrismaticConstraint

A PrismaticConstraint is a physical constraint between two physical models that simulates the effect of sliding on a
rail. The objects are held in a fi xed relative orientation to each other, and at a fi x displacement orthogonal to the rail,
but are free to slide along the rail direction. It is useful for sliding doors, elevators etc. The constraint is created using a
fast constraint solver, after which the relative motion will be constrained to sliding along the axis direction.
It should be noted that for any of the physics based constraints or actions, it is necessary to assign reasonable mass
values when creating the physical models so that physics processing does not become unstable (driven out of scope).
The guidelines for mass and inertia are decribed in the method createPhysicalModel().
= 1.0;
= 1.0;
= Vector(0, 0, 0);
star.physicalModel);

Advertisement

Table of Contents
loading

Table of Contents