User Guide

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