370
Chapter 16: Working with Models and Model Resources
Collision modifier properties
The collision modifier allows a model to be notified of and respond to collisions. You can access a
model’s collision modifier properties using syntax such as
model.collision.
whichProperty
.
Detecting collisions and responding to collisions are separate tasks. If the
enabled
property is set
to
TRUE
, and a script has been registered to be notified of collisions using the
setCollisionCallback()
method, that script instance receives a callback. However, the
collision isn’t resolved unless the
resolve
property is also set to
TRUE
.
This separation is deliberate and valuable: it can be important for a collision to be registered. In a
game, for example, a projectile could strike a wall and the player’s score could be increased. In that
same game, however, you might not want the projectile to bounce off the wall. In that case, you’d
set the
enabled
property to
TRUE
and set the
resolve
property to
FALSE
.
Collision notification can also be implemented by using
registerScript()
on a specific model
in addition to using the
setCollisionCallback()
technique.
Use these properties to work with the collision modifier:
whichModel
.sds.tension
Get and set
Percentage of matching between
modified and original surfaces.
65
whichModel
.sds.error
Get and set
Percentage of error tolerance. This
property applies only if sds.subdivision
equals
#adaptive
.
0.0
Property
Access
Description
Default
whichModel
.collision.e
nabled
Get and set
TRUE (1)
or
FALSE (0)
value indicating
whether collisions between this model
and other models will trigger a collision
event.
TRUE (1)
whichModel
.collision.r
esolve
Get and set
TRUE (1)
or
FALSE (0)
value indicating
whether collisions are automatically
resolved. If the value is
TRUE (1)
and if
the other model has the
collision
modifier applied and has
enabled
set to
TRUE (1)
, the models will be moved back
to the position of their original contact.
TRUE (1)
Property
Access
Description
Default
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...