Pointtopointconstraint - Adobe ATMOSPHERE User Manual

Table of Contents

Advertisement

Methods
setWorldSpacePivotAndAxis(Vector pivot, Vector axis)
A point defi ning the location of the constraint, and the hinge axis direction.
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.createHingeConstraint(cube.physicalModel, star.physicalModel);
constraint.strength
constraint.tau
pivot
axis
constraint.setWorldSpacePivotAndAxis(pivot, axis);
removeAnimator(this);
}
}
addAnimator(loader);

PointToPointConstraint

A point to point constraint between two physical models simulates the effects of a physical ball joint. The constraint
includes a pivot point about which the two physical models rotate freely. The pivot point is specifi ed in world space
for the initial placement relative to the two physical models. Such a constraint is created using a fast constraint solver.
After that, the two objects will be constrained to act as if there is a ball-joint between them.
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().
Properties
strength
The strength or stiffness of the constraint.
= 1.0;
= 1.0;
= Vector(0, 0, 0);
= Vector(0, 1, 0);
369
ADOBE ATMOSPHERE
User Guide

Advertisement

Table of Contents
loading

Table of Contents