Adobe ATMOSPHERE User Manual page 311

Table of Contents

Advertisement

this.physicalModel.transform = anchorA.transform;
this.physicalModel.collide = true;
this.button = Button("MoveTo Anchor B").add();
this.button.onClick = function()
{
box.physicalModel.moveTo(anchorB.position);
}
removeAnimator(this);
}
}
addAnimator(box);
rotateTo(orientation)
This method schedules an update to the orientation property using a smooth interpolation over the next
time step period. This smooth kinematic motion is more stable when other objects collide with the current
object. By the next time step the angular velocity and angular acceleration will be set to zero.Note that it is
not recommended that you set this value in a timestep, meaning to set a new value every frame. The most
dependable method for moving a Physical Model (apart from using constraints or the collision with another
object) is to use the 'ApplyImpulse()' methods. Note that rotations in Atmosphere are in the units of Radians (a
full circle = pi * 2).
anchorA = stageModel.getPrimitive("A");
anchorB = stageModel.getPrimitive("B");
box = SceneGroup("./box.aer").add();
box.timestep = function()
{
if(this.loaded)
{
this.physicalModel = this.createPhysicalModel(10);
this.physicalModel.transform = anchorA.transform;
this.physicalModel.collide = true;
this.button = Button("RotateTo Anchor B").add();
this.button.onClick = function()
{
box.physicalModel.rotateTo(anchorB.orientation);
}
removeAnimator(this);
}
}
addAnimator(box);
transformTo(transform)
This method schedules an update to the orientation and position properties using a smooth interpolation over
the next time step period. This smooth kinematic motion is more stable when other objects collide with the
current object. By the next time step the velocity, acceleration, angular velocity and angular acceleration will
299
ADOBE ATMOSPHERE
User Guide

Advertisement

Table of Contents
loading

Table of Contents