Base class for objects that can participate in collision detection. More...
#include <Collidable.h>
Public Member Functions | |
const CollisionVolume & | GetCollisionVolume () |
Gets the collision volume bounding sphere. | |
const CollisionVolumeBSphere & | GetDefaultBSphere () const |
Gets the collision volume bounding sphere. | |
Protected Member Functions | |
Collidable (const Collidable &)=delete | |
Collidable & | operator= (const Collidable &)=delete |
template<typename C> | |
void | SetCollidableGroup () |
Sets the collidable group for the object. | |
void | SubmitCollisionRegistration () |
Submits the collision registration for the GameObject. | |
void | SubmitCollisionDeregistration () |
Submits the collision deregistration for the GameObject. | |
void | SetColliderModel (Model *mod, VolumeType v) |
Sets the collider model for the GameObject. | |
void | UpdateCollisionData (const Matrix &mat) |
Updates the collision data for the GameObject. | |
void | VisualizeCollisionVolume (VolumeType t, const Vect &color) const |
Sets the color of the bounding sphere for visualization. | |
void | VisualizeDefaultBSphere (const Vect &color) const |
Sets the default bounding sphere color for the collidable object. | |
void | VisualizeGroupAABB (const Vect &color) const |
Displays the group AABB for debugging purposes. | |
Private Member Functions | |
void | SceneRegistration () |
Registers the GameObject for collisions in the scene. | |
void | SceneDeregistration () |
Deregisters the GameObject from collisions in the scene. | |
CollidableGroup::CollidableCollectionRef & | GetGroupRef () |
Gets the group reference for the GameObject. | |
void | UpdateDefaultBSphere (const Matrix &mat) |
Updates the default bounding sphere for the collidable object. | |
Private Attributes | |
CollisionManager::PWTypeID | myTypeID = CollisionManager::PWID_UNDEFINED |
The type ID of the collidable group. | |
RegistrationState | RegStateCurr |
The current registration state of the GameObject. | |
CollisionRegistrationCommand * | ptrColRegistrationCmd |
Pointer to the collision registration command for the GameObject. | |
CollisionDeregistrationCommand * | ptrColDeregistrationCmd |
Pointer to the collision deregistration command for the GameObject. | |
CollidableGroup::CollidableCollectionRef | pGroupRef |
Reference to the collidable group collection iterator. | |
CollisionVolume * | pColVolume |
Pointer to the collision volume for the GameObject. | |
Model * | pColModel |
Pointer to the collider model. | |
CollisionVolumeBSphere * | defaultBSphere |
Default bounding sphere for the collidable object. | |
Friends | |
class | CollidableAttorney |
Base class for objects that can participate in collision detection.
The Collidable
class provides a base implementation for objects that need to participate in collision detection. It manages registration and deregistration with the CollisionManager
and provides methods to set the collider model and update collision data.
const CollisionVolume & Collidable::GetCollisionVolume | ( | ) |
Gets the collision volume bounding sphere.
const CollisionVolumeBSphere & Collidable::GetDefaultBSphere | ( | ) | const |
Gets the collision volume bounding sphere.
|
private |
Gets the group reference for the GameObject.
|
inlineprotected |
Sets the collidable group for the object.
C | The type of the collidable group. |
|
protected |
Sets the collider model for the GameObject.
mod | Pointer to the model. |
|
protected |
Updates the collision data for the GameObject.
mat | The transformation matrix. |
|
private |
Updates the default bounding sphere for the collidable object.
mat | The transformation matrix. |
|
protected |
Sets the color of the bounding sphere for visualization.
col | The color to set. |
|
protected |
Sets the default bounding sphere color for the collidable object.
col | The color to set. |