User Guide
ADOBE ATMOSPHERE 363
User Guide
position = magCenter.position;
strength
The relative strength of the magnetic force. Positive values result in an attractive force, and negative values apply
a repulsive force. Useful range is between -1000 and 1000.
magneticAction.strength = 200;
Local Methods
addPhysicalModel (PhysicalModel)
Specifi es a PhysicalModel which will experience the Magnetic Action. Many SceneGroups may be added.
magneticAction.addPhysicalModel(box.physicalModel);
Code Sample
box = SceneGroup(“./box.aer”).add();
box.anchor = theStage.getPrimitive(“anchor1”);
box.transform = box.anchor.transform;
magCenter = theStage.getPrimitive(“magCenter”);
magSolver = FastConstraintSolver();
loader = new Object();
loader.timestep = function(now)
{
if (!box.loaded) return;
box.physicalModel = box.createConvexPhysicalModel(10);
box.physicalModel.collide = true;
box.physicalModel.acceleration = Vector(0.0, -32.0, 0.0);
strength = 200;
falloff = 0;
angle = 2.0 * 3.1415927;
maxDistance = 100;
position = magCenter.position;
direction = Vector( 0, 0, 0 );
magAction = magSolver.createMagneticAction(
strength, falloff, angle, maxDistance, position, direction);
magAction.addPhysicalModel(box.physicalModel);
magSolver.addAction(magAction);
removeAnimator(loader);
}
addAnimator(loader);










