Collision subsystem

Actor objects interact--usually by running into each other. By inheriting from MColliding, an actor can recognize when it's involved in an interaction.
Here's how it works:

    When an object moves, it sends a notification to the appropriate behavior objects (TExplosionBehavior and TBoundingBoxBehavior). The behavior objects determine if the movement caused an interaction. If an interaction is sensed, a behavior object acts appropriately. For example, when a large asteroid collides with a bullet, TExplosionBehavior sends the asteroid an Explode call, which--because it's a large asteroid--breaks the asteroid into two medium asteroids.
An actor is connected to its appropriate behaviors by the universe when the universe adopts the actor. (The universe disconnects an actor when it orphans the actor.)


The TCollisionBehavior abstract class represents a behavior between an actor and its environment or between two or more actors--it defines an abstract protocol through which actors can interact. It has two concrete derived classes: TExplosionBehavior and TBoundingBoxBehavior.

The MColliding class provides protocol through which a TCollisionBehavior is notified of changes in the simulation.


[Contents] [Previous] [Next]
Click the icon to mail questions or corrections about this material to Taligent personnel.
Copyright©1995 Taligent,Inc. All rights reserved.

Generated with WebMaker