Motoraction - Adobe ATMOSPHERE User Manual

Table of Contents

Advertisement

364
APPENDIX E

MotorAction

A "MotorAction" may be used to apply rotational behavior to a physical model. The motor action is created by a
method of the "FastConstraintSolver", and applies to a single physical model. Motor action properties represent the
common controls and measurements available in real-world motor controllers.
Local Properties
gain
This property represents the strength of the motor at any given moment, calculated as the difference between
current speed and the desired speed times the gain. If you desire for the motor to have suffi cient strength to
move other objects, values of 100 or greater should likely be used (depending upon the mass of the objects to be
moved). Default value for the 'controller-motor' preset script is 100.
motorAction.gain = 3;
maxTorque
The maximum torque available to the motor (torque is a measurement of the rotational force produced by the
motor armature). In the Atmosphere application, 'maxTorque' acts as a limit to the gain property.
motorAction.maxTorque = 3;
spinRate
The rotational speed desired for the motor (angular velocity). Note that if insuffi cient torque is available,
themotor will not reach the desired speed. See the description for maxTorque above.
motorAction.spinRate = 3;
Code Sample
armature
armature.anchor
armature.transform
armature.solver
armature.timestep
{
if (!armature.loaded) { return; }
armature.physicalModel
armature.physicalModel.collide
armature.physicalModel.acceleration = Vector(0.0, 0.0, 0.0);
//method expects 5 parameters
armature.action = armature.solver.createMotorAction(
armature.physicalModel,
armature.anchor.position,
3,
3,
3);
= SceneGroup("./armature.aer").add();
= theStage.getPrimitive("anchor");
= armature.anchor.transform;
= FastConstraintSolver();
= function(now)
= armature.createPhysicalModel(1);
= true;
//physicalModel
//axis
//spinRate
//gain
//maxTorque

Advertisement

Table of Contents
loading

Table of Contents