palCollisionDetection Class Reference
#include <palCollision.h>
Inherited by palCollisionDetectionExtended.
List of all members.
|
Public Member Functions |
virtual void | SetCollisionAccuracy (Float fAccuracy)=0 |
virtual void | SetGroupCollision (palGroup a, palGroup b, bool enabled)=0 |
virtual void | RayCast (Float x, Float y, Float z, Float dx, Float dy, Float dz, Float range, palRayHit &hit)=0 |
virtual void | NotifyCollision (palBodyBase *a, palBodyBase *b, bool enabled)=0 |
virtual void | NotifyCollision (palBodyBase *pBody, bool enabled)=0 |
virtual void | GetContacts (palBodyBase *pBody, palContact &contact)=0 |
virtual void | GetContacts (palBodyBase *a, palBodyBase *b, palContact &contact)=0 |
Detailed Description
The collision detection subsystem. The collision detection sub system is the portion of the main physics engine responsible for determining whether and where objects are colliding. It enables querying the geometry of the world, for example ray casting. If you wish PAL to keep track of collision that occur you must call the 'Notify' functions for each body. Colliding objects can be set to be in different collision groups to allow non-interacting collisions. Not all engines support a seperate collision detection query system, so collision support for a physics engine must be tested before use. Example:
palPhysics*pp = PF->GetActivePhysics();
palCollisionDetection *pcd = dynamic_cast<palCollisionDetection *>(pp);
if (!pcd)
//error.
Member Function Documentation
Returns the contact points.Œ A collision notification must be set up before any contact points can be returned.
virtual void palCollisionDetection::GetContacts |
( |
palBodyBase * |
pBody, |
|
|
palContact & |
contact | |
|
) |
| | [pure virtual] |
Returns the contact points. A collision notification must be set up before any contact points can be returned.
virtual void palCollisionDetection::NotifyCollision |
( |
palBodyBase * |
pBody, |
|
|
bool |
enabled | |
|
) |
| | [pure virtual] |
Enables listening for a collision involving a body.
- Parameters:
-
| pBody | The body which listens for all collisions |
| enabled | Enable/disable listening for a collision |
virtual void palCollisionDetection::NotifyCollision |
( |
palBodyBase * |
a, |
|
|
palBodyBase * |
b, |
|
|
bool |
enabled | |
|
) |
| | [pure virtual] |
Enables listening for a collision between two bodies.
- Parameters:
-
| a | The first body |
| b | The second body |
| enabled | Enable/disable listening for a collision |
virtual void palCollisionDetection::RayCast |
( |
Float |
x, |
|
|
Float |
y, |
|
|
Float |
z, |
|
|
Float |
dx, |
|
|
Float |
dy, |
|
|
Float |
dz, |
|
|
Float |
range, |
|
|
palRayHit & |
hit | |
|
) |
| | [pure virtual] |
Queries the collision system for a ray interesection. Requires the origin and heading of the ray.
If a ray has hit, the palRayHit is filled with the body that has been hit, and if available, the geometry that was hit.
- Parameters:
-
| x | The position (x) of the ray |
| y | The position (y) of the ray |
| z | The position (z) of the ray |
| dx | The direction vector (x) of the ray |
| dy | The direction vector (y) of the ray |
| dz | The direction vector (z) of the ray |
| range | The maximum range to test |
| hit | The ray hit information |
virtual void palCollisionDetection::SetCollisionAccuracy |
( |
Float |
fAccuracy |
) |
[pure virtual] |
Sets the accuracy of the collision detection system
- Parameters:
-
| fAccuracy | Ranges from 0..1, 0 indicates fast and inaccurate, 1 indicates accurate and slow. |
virtual void palCollisionDetection::SetGroupCollision |
( |
palGroup |
a, |
|
|
palGroup |
b, |
|
|
bool |
enabled | |
|
) |
| | [pure virtual] |
Sets the interactions between collision groups to enabled/disabled
The documentation for this class was generated from the following files:
- /var/www/hosted/adrianboeing.com/pal/current/pal/pal/pal/palCollision.h
- /var/www/hosted/adrianboeing.com/pal/current/pal/pal/pal/palCollision.cpp