Adobe ATMOSPHERE User Manual page 310

Table of Contents

Advertisement

298
APPENDIX E
loader = new Object();
loader.timestep = function()
{
if(box1.loaded && box2.loaded)
{
box1.physicalModel = this.createPhysicalModel(2);
box2.physicalModel = this.createPhysicalModel(5);
box1.physicalModel.disableCollisionsWith(box2.physicalModel);
removeAnimator(this);
}
}
addAnimator(loader);
enableCollisionsWith(PhysicalModel)
This function undoes the effect of disableCollisionsWith(physicalModel). It removes the pair of collisions that
are currently being ignored from the list, so that collisions between these two objects will no longer be ignored.
box1.physicalModel.enableCollisionsWith(box2.physicalModel);
disableDeactivation()
Prevents the physical model from being deactivated when it comes to rest. For SceneGroups being modifi ed with
moveTo and transformTo, the call to disableDeactivation must be made once to prevent the object from being
disabled by the automatic deactivation criteria.
box1.physicalModel.disableDeactivation();
enableDeactivation()
For use following the above method, will allow the physical model to once again be deactivated when it comes to
rest.
box1.physicalModel.enableDeactivation();
moveTo(Vector position)
This method schedules an update to the position 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 velocity and 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.
anchorA = stageModel.getPrimitive("A");
anchorB = stageModel.getPrimitive("B");
box = SceneGroup("./box.aer").add();
box.timestep = function()
{
if (this.loaded)
{
this.physicalModel = this.createPhysicalModel(10);

Advertisement

Table of Contents
loading

Table of Contents