Collisions
395
These properties are included in the
collisionData
object passed to the handler:
Collision methods
Collision methods let you override certain aspects of the default behavior set for models during
collisions. If neither of the models involved in the collision has
resolve
set to
TRUE
, you can
manually resolve the collision using
resolveA(true)
for model A or
resolveB(true)
for
model B.
Selecting models
Selecting models (picking) refers to clicking on models in a 3D cast member. Because models are
objects that exist within a 3D cast member and a 3D sprite, they are not normally sensitive to
mouse clicks. Normally it is only the entire sprite that is sensitive to mouse clicks.
You can use scripts to determine specifically which models have been clicked when a user clicks
within a 3D sprite. In practice, this allows for changing model positions to make it appear that an
action such as a button being pushed or a door being opened has taken place, or to allow the user
to select or drag an object. Picking can be accomplished by using cast member or camera
methods.
Property
Access
Description
modelA
Get
One model in the collision.
If the script includes registration for collision with a
particular model,
modelA
is that model.
modelB
Get
The second model in the collision.
pointOf
Contact
Get
Vector describing world-space location of collision.
Available only if the collision has been resolved. Occurs
if the model’s collision modifier
resolve
property is
TRUE
(1)
or either the
collisionData resolveA()
or
collisionData resolveB()
method is called.
collision
Normal
Get
Vector indicating direction of collision. Available only if
the collision has been resolved. Occurs if the model’s
collision modifier
resolve
property is
TRUE (1)
or either
the
collisionData resolveA()
or
collisionData
resolveB()
method is called.
Method
Description
Returns
collisionData.resolveA
(
trueOrFalse
)
Resolves collision for model A.
Nothing
collisionData.resolveB
(
trueOrFalse
)
Resolves collision for model B. If the argument is
FALSE
(0)
, the collision won’t be resolved. This overrides the
collision.resolve
property, if any, set for model B.
Nothing
Summary of Contents for DIRECTOR MX 2004-USING DIRECTOR
Page 1: ...DIRECTOR MX 2004 Using Director...
Page 16: ...16 Chapter 1 Introduction...
Page 82: ...82 Chapter 3 Sprites...
Page 98: ...98 Chapter 4 Animation...
Page 134: ...134 Chapter 5 Bitmaps...
Page 242: ...242 Chapter 10 Sound and Synchronization...
Page 274: ...274 Chapter 11 Using Digital Video...
Page 290: ...290 Chapter 12 Behaviors...
Page 302: ...302 Chapter 13 Navigation and User Interaction...
Page 334: ...334 Chapter 15 The 3D Cast Member 3D Text and 3D Behaviors...
Page 392: ...392 Chapter 16 Working with Models and Model Resources...
Page 418: ...418 Chapter 18 Movies in a Window...
Page 446: ...446 Chapter 22 Managing and Testing Director Projects...