QSDK 1.1 Documentation
Main Page | Modules | Class Hierarchy | Alphabetical List | Compound List | File List | Compound Members | File Members | Related Pages

Q::IntersectionManager Struct Reference
[Intersection]

Links entities and intersection events. More...

#include <Q/gamedev.h>

Inheritance diagram for Q::IntersectionManager:

Com::Unknown List of all members.

Public Types

typedef Com::Ptr< IntersectionManagerPTR

Public Member Functions

virtual Utils::Result add (EntityInstance *, const Instance &, unsigned int type)=0
virtual Utils::Result remove (EntityInstance *, unsigned int type)=0
virtual Utils::Result remove (EntityInstance *)=0

Static Public Member Functions

PTR theManager ()

Static Public Attributes

Com::UUID IID
Com::UUID CLSID

Detailed Description

Links entities and intersection events.

The intersection manager tracks the interactions between instances (normally of regions). An entity might have more than one instance that defines its volume, each one having a different meaning. For example, an entity might have a fighting range, a listening range and a physical size. The physical size might even be broken down into multiple instances for different body parts. This is where the type code comes in for each of the methods. The type code has no meaning to the intersection manager and is used only to indicate to the entity which instance the intersection occurred on. The Entity must implement two methods to receive intersection events. These are Entity::entered and Entity::exited. They both receive the type code of the instance, the other entity and the type code of their instance.

Warning:
An instance can only have at most one type and at most one entity associated with it. Entities cannot share instances. Instances cannot have multiple types associated with them.
Note:
Entities are notified when two of their instances with different types intersect each other. They will receive two symmetric events, one for either sides. However entity instances are not notified if the intersecting instances have the same type.


Member Typedef Documentation

typedef Com::Ptr<IntersectionManager> Q::IntersectionManager::PTR
 

A COM pointer to an object of this class


Member Function Documentation

virtual Utils::Result Q::IntersectionManager::add EntityInstance ,
const Instance ,
unsigned int  type
[pure virtual]
 

Register an instance to be intersectable with the specified type and the specified type. In case of failure, the method returns Utils::InvalidArgument if one of the parameters were invalid, it returns Utils::ENotUnique if the instance is already registered in the IntersectionManager.

virtual Utils::Result Q::IntersectionManager::remove EntityInstance  )  [pure virtual]
 

Stop detecting intersection. Deregister the specified entity completely. If the specified type is not registered with the specified EntityInstance, the method returns Utils::ENotFound.

virtual Utils::Result Q::IntersectionManager::remove EntityInstance ,
unsigned int  type
[pure virtual]
 

Stop detecting intersection for instances with the specified type. If the specified type is not registered with the specified EntityInstance, the method returns Utils::ENotFound.

IntersectionManager::PTR Q::IntersectionManager::theManager  )  [inline, static]
 

The singleton IntersectionManager


Member Data Documentation

Com::UUID Q::IntersectionManager::CLSID [static]
 

COM CLSID 3b5ff451-af44-494a-b313-e22033b4a042

Com::UUID Q::IntersectionManager::IID [static]
 

COM IID 8f4c5a22-3b12-42cf-87b0-ffe5e1f17568

Reimplemented from Com::Unknown.

Return to QSDK documentation Contents page. Contact details for support, information and fault-reporting.
Qube Software Limited © 2000-2004