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

vLooped = TRUE<br />

vStartTime = 500<br />

vEndTime = 600<br />

vRate = 0.1<br />

vOffset = 250<br />

vModel.bonesPlayer.queue(vMotionName, vLooped, vStartTime, vEndTime, vRate, vOffset)<br />

// JavaScript syntax<br />

vLooped = true;<br />

vStartTime = 500;<br />

vEndTime = 600;<br />

vRate = 0.1;<br />

vOffset = 250;<br />

vModel.getPropRef("bonesPlayer", 1).queue(vMotionName, vLooped, vStartTime, vEndTime, vRate,<br />

vOffset);<br />

When it is this motion's turn to play, it will start playing 250 milliseconds from the beginning, then play up to<br />

millisecond 600, and then continue to cycle between 500 and 600. It will play at one-tenth of its normal speed.<br />

For information on blending motions, see autoBlend, blendTime, and blendFactor.<br />

Collisions<br />

All that you can see in a virtual 3D world are pixels. The models are just the projection of abstract objects onto your<br />

screen. To give these pixels the illusion of solidity, you must prevent them from appearing to intersect with each other.<br />

Collision detection requires testing on each frame whether each moving model has attempted to pass through every<br />

solid model in the scene. In a busy scene, this can require very intensive use of the computer processor. To improve<br />

performance, it is important to limit the number of calculations to those situations where a collision is likely.<br />

Detecting collisions<br />

<strong>Director</strong> provides a number of ways of detecting collisions between models.<br />

The #collision modifier manages the detection and resolution of collisions. It was introduced in <strong>Director</strong> 8.5 and<br />

has not evolved since. It can handle simple collisions that occur between models that are moving relatively slowly<br />

compared to their size. See “Collision modifier” on page 280.<br />

The simplest way to prevent two models from colliding with each other is to ensure that they never get close enough<br />

to each to touch. See “Custom collision detection” on page 283 for a discussion of some fast techniques.<br />

When only one model is moving in an otherwise static world, you can cast a ray along the direction of motion of<br />

the moving model to see whether there is another object in its path. You only need to cast a ray when the moving<br />

model changes direction. See “Rays” on page 285 for more details.<br />

The Ageia Physics Xtra is a high-performance tool that helps developers create 3D worlds in which objects interact.<br />

The Xtra performs calculations to determine the results of collisions, factoring in object properties such as mass,<br />

velocity, and rotation. See “Physics” on page 293 for more details.<br />

Last updated 8/26/2011<br />

279

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

Saved successfully!

Ooh no, something went wrong!