07.12.2012 Views

Adobe Director Basics

Adobe Director Basics

Adobe Director Basics

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

ADOBE DIRECTOR BASICS<br />

3D: Controlling action<br />

In the test above, notice how the linearVelocity and linearMomentum indicate that the centerOfMass is moving<br />

at a constant rate along the zAxis. However, the position of the rigidBody oscillates on the xAxis as the block rotates<br />

around its centerOfMass.<br />

Try dragging the pinhead to change the orientation axis, and dragging the position and orientation angle sliders to see<br />

how this affects the block.<br />

Note: When the orientation angle is zero or 360°, the orientation axis will automatically be set to vector(1, 0,<br />

0). If you want to rotate a rigidBody around a different axis, be sure that you set both the axis and the angle each time.<br />

The orientation axis is automatically set to vector(1, 0, 0) for angles of 0 and 360<br />

For a comparison of rigidBody.attemptMoveTo() and setting the rigidBody.position property, see “Rigid body<br />

methods” on page 316.<br />

Note: Notice how the orientation angle moves backwards and forwards between 0 and 360 and that the orientation axis<br />

flips through 180° each time the angle reaches 0 or 360.<br />

Static properties<br />

A rigidBody created with a body type of #static will never move as the result of a collision. You can stop a #dynamic<br />

rigidBody from moving in two different ways.<br />

rigidBody.isPinned can be TRUE or FALSE. If you set it to TRUE, then a dynamic rigidBody will behave like a static<br />

one. If it is struck by a moving dynamic rigidBody, it will remain pinned to its current position.<br />

Last updated 8/26/2011<br />

314

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

Saved successfully!

Ooh no, something went wrong!