User Guide
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