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 />

Get-only properties<br />

A D6Joint object has five properties whose value is set at the moment that you call createD6Joint(), and which cannot<br />

be changed later. Attempting to alter the value of these properties will lead to a script error.<br />

constraint.name<br />

d6joint.objectA<br />

d6joint.objectB<br />

constraint.constraintType (D6Joints are a type of constraint, just like linear and angular joints. The<br />

constraintType for D6Joint is #d6joint)<br />

Anchor properties<br />

A D6Joint object has three properties that define the mutual frame of reference of the joined rigidBody objects.<br />

d6joint.globalAnchor<br />

d6joint.localAnchorA<br />

d6joint.localAnchorB<br />

The Physics simulation uses world space as a frame of reference for all objects that it controls. When you create a<br />

D6Joint, you define a position in world space as the globalAnchor point for the joint. The two rigidBody objects now<br />

share a mutual point of reference: the globalAnchor. Each of the rigidBody objects joined by the joint converts that<br />

worldPosition point into its own local frame of reference. These references are stored in the localAnchorA (for the<br />

first named rigidBody) and localAnchorB (for the second rigidBody).<br />

If the rigidBody objects now move together, with respect to the world, the worldPosition of their globalAnchor will<br />

change. It is “global” only in the sense that it is shared by both rigidBodies in the joint. Each rigidBody will maintain<br />

its own position and orientation relative to the shared globalAnchor point.<br />

If you alter the values of localAnchorA or localAnchorB the associated rigidBody will move to a new position with<br />

the respect to the mutual globalAnchor point.<br />

If you change the value of the globalAnchor the values of localAnchorA or localAnchorB will update to reflect the<br />

current positions of the two rigidBody objects with respect to the new globalAnchor point.<br />

Note: If you create a joint with only one rigidBody and VOID as the other party to the joint, then changing the<br />

globalAnchor point will affect the center of rotation of the sole rigidBody.<br />

Freedom properties<br />

You can set the freedom of each of the six types of motion available to a D6Joint. The following properties can take the<br />

values #locked, #limited, or #free:<br />

d6joint.axisMotion: refers to linear motion along the main zAxis<br />

d6joint.normalMotion: refers to linear motion along the xAxis<br />

d6joint.biNormalMotion: refers to linear motion along the yAxis<br />

d6joint.twistMotion: refers to angular motion around the main zAxis<br />

d6joint.swing1Motion: refers to angular motion around the xAxis<br />

d6joint.swing2Motion: refers to angular motion around the yAxis<br />

See “D6Joints” on page 338 for a demonstration of these different motions.<br />

Last updated 8/26/2011<br />

345

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

Saved successfully!

Ooh no, something went wrong!