What's New in Director 8.5 > Controlling the 3D World > Collisions > Collision properties

 

Collision properties

When a collision occurs, it generates a collideWith event.The collideWith event passes an argument to the handler that is declared with the registerForEvent or setCollisionCallBack command. This argument is called a collisionData object and contains a property list with detailed information about the collision.

These properties are included in the collisionData object passed to the handler:

Property

Access

Description

modelA

Get

One model in the collision.

If the Lingo script includes registration for collision with a particular model, modelA is that model.

modelB

Get

The second model in the collision.

pointOfContact

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.

collisionNormal

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.