User Guide
358 APPENDIX E
createDragAction()
Creates and returns a new “DragAction”.The action has the effect of slowing down the momentum of objects for
both direction and rotation.
solver = FastConstraintSolver();
velocityDrag = 1;
angularVelocityDrag = 1;
dragAction = solverA.createDragAction(velocityDrag, angularVelocityDrag);
solverA.addAction(dragAction);
createFluidAction()
Creates and returns a new “FluidAction”. A Fluid Action causes all dynamic physical models in the world to
behave as though the world were fi lled with a fl uid.
solver = FastConstraintSolver();
fl uidAction = solver.createFluidAction();
fl uidAction.damping = 1;
solver.addAction(fl uidAction);
createMagneticAction(strength, falloff, angle, maxDistance, position, direction)
Creates and returns a new “MagneticAction”. This action simulates the effect of magnetic attraction or repulsion
on physical models. Note that only ‘active’, ‘falloff’, and ‘strength’ may be modifi ed following the creation of the
Magnetic Action. All other properties are specifi ed at creation time only, and remain constant thereafter.
strength = 100;
falloff = 0;
angle = 2.0 * 3.1415927;
maxDistance = 100;
position = Vector( 0, 0, 0 );
direction = Vector( 0, 0, 0 );
solver = FastConstraintSolver();
magAction = solver.createMagneticAction(strength, falloff, angle, maxDistance,
position, direction);
magAction.addPhysicalModel(box.physicalModel);
magAction.addPhysicalModel(cone.physicalModel);
solver.addAction(magAction);
createMotorAction(PhysicalModel, axis, spinRate, gain, maxTorque)
Creates and returns a new “MotorAction”. This action simulates the effect of wind on a physical model.
axis = Vector( 0, 0, 0 );
spinRate = 3.0;
gain = 3.0;
maxTorque = 3.0;
solver = FastConstraintSolver();
motorAction = solver.createMotorAction(PhysicalModel, axis, spinRate, gain, maxTorque);
solver.addAction(motorAction);










