User Guide
Modifiers 371
Collision modifier methods
Use this method to work with the collision modifier:
whichModel.collision.i
mmovable
Get and set TRUE (1) or FALSE (0) value indicating
whether the model can be moved. If a
model cannot be moved, the 3D Xtra
can save time by not checking it for
collisions with other models that also
have their
immovable property set to
TRUE.
FALSE (0)
whichModel.collision.
mode
Get and set Indicates the geometry to be used in the
collision detection algorithm. Using
simpler geometry such as the bounding
sphere leads to better performance. The
possible values for this property are:
#mesh: uses the actual mesh geometry of
the model's resource. This gives one-
triangle precision and is usually slower
than #box or
#sphere.
#box: uses the bounding box of the
model. This is useful for objects that can
fit more tightly in a box than in a sphere,
such as a wall.
#sphere: is the fastest mode, because it
uses the bounding sphere of the model.
This is the default value for this property.
Method Description Returns
whichModel.collision.
setCollisionCallback
(#handlerName, scriptObjectName)
If collision.enabled is set to TRUE (1),
this method registers the script instance
to receive an event when a collision
occurs. If
collision.enabled is set to
FALSE (0), no event occurs. What
happens when a collision occurs
depends on the value assigned to the
resolve property. You can override this
value by using the
collisionData.resolveA() or
collisionData.resolveB() methods.
The
collisionData object will be the
second argument passed to
#handlerName in the specified script
object
scriptObjectName.
Nothing
Property Access Description Default