07.12.2012 Views

Adobe Director Basics

Adobe Director Basics

Adobe Director Basics

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

ADOBE DIRECTOR BASICS<br />

3D: Controlling action<br />

-- Lingo syntax<br />

member("Physics").getRigidBody("Ground").restitution = 0.42<br />

// JavaScript syntax<br />

member("Physics").getRigidBodies()[1].restitution = 0.42;<br />

Testing how the Cube bounces when the value of its restitution changes<br />

Test what happens when you alter the restitution of the Ground and the Cube rigidBody objects separately to get a feel<br />

of how this property works.<br />

Note: Setting restitution to its maximum value of 1.0 can lead to rounding errors where the energy of a bouncing<br />

object actually increases. Be cautious of setting restitution above 0.95.<br />

friction<br />

Friction depends on the force with which two objects are pressed together. To test this, set a non-zero value for both<br />

gravity and friction, and then click the Push Cube button. You can see that modifying either gravity or friction<br />

will have an effect on the behavior of the Cube.<br />

Last updated 8/26/2011<br />

302

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!