Adobe ATMOSPHERE User Manual page 288

Table of Contents

Advertisement

276
APPENDIX E
buildingOverlap = OverlapEventHandler();
Local Callbacks
onEnter(PhysicalModelA, PhysicalModelB)
A method which defi nes what will happen when an overlap initially occurs. The two physical models involved in
the overlap are also returned. These values can be tested for parent or type, and customized actions performed
based upon the results.
buildingOverlap.onEnter = function(physicalModelA, physicalModelB)
{
if ( physicalModelA.getParent().type == "Player" ||
{
chat.print("The Player has entered the building.");
}
}
onLeave(PhysicalModelA, PhysicalModelB)
Similar to above, a method which defi nes what will happen when an overlap is discontinued. The two physical
models that were involved in the overlap are also returned. These values can be tested for parent or type, and
customized actions performed based upon the results.
buildingOverlap.onLeave = function(physicalModelA, physicalModelB)
{
if ( physicalModelA.getParent().type == "Player" ||
{
chat.print("The Player has left the building.");
}
}
Local Methods
setFilterNoPhysicalModel()
Specifi es that the overlap event handler should respond to all overlaps between all physical models (that is, do
not limit the event handler to any specifi c SceneGroups).
buildingOverlap.setFilterNoPhysicalModel();
setFilterPhysicalModel(PhysicalModel)
Specifi es that the overlap event handler should respond to all overlaps for a single physical model.
buildingOverlap.setFilterPhysicalModel(boxPhysicalModel);
setFilterPhysicalModels(PhysicalModel, PhysicalModel)
Specifi es that the overlap event handler should be limited to overlaps between two physical models.
buildingOverlap.setFilterPhysicalModel(boxPhysicalModel, conePhysicalModel);
physicalModelB.getParent().type == "Player" )
physicalModelB.getParent().type == "Player" )

Advertisement

Table of Contents
loading

Table of Contents