SUNENGINE 0.0.2
A simple and bright C++ game engine.
 
Loading...
Searching...
No Matches
Collidable Class Reference

Base class for objects that can participate in collision detection. More...

#include <Collidable.h>

Inheritance diagram for Collidable:
Inheritance graph

Public Member Functions

const CollisionVolumeGetCollisionVolume ()
 Gets the collision volume bounding sphere.
 
const CollisionVolumeBSphereGetDefaultBSphere () const
 Gets the collision volume bounding sphere.
 

Protected Member Functions

 Collidable (const Collidable &)=delete
 
Collidableoperator= (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::CollidableCollectionRefGetGroupRef ()
 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.
 
CollisionRegistrationCommandptrColRegistrationCmd
 Pointer to the collision registration command for the GameObject.
 
CollisionDeregistrationCommandptrColDeregistrationCmd
 Pointer to the collision deregistration command for the GameObject.
 
CollidableGroup::CollidableCollectionRef pGroupRef
 Reference to the collidable group collection iterator.
 
CollisionVolumepColVolume
 Pointer to the collision volume for the GameObject.
 
Model * pColModel
 Pointer to the collider model.
 
CollisionVolumeBSpheredefaultBSphere
 Default bounding sphere for the collidable object.
 

Friends

class CollidableAttorney
 

Detailed Description

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.

Member Function Documentation

◆ GetCollisionVolume()

const CollisionVolume & Collidable::GetCollisionVolume ( )

Gets the collision volume bounding sphere.

Returns
The collision volume bounding sphere.
Here is the caller graph for this function:

◆ GetDefaultBSphere()

const CollisionVolumeBSphere & Collidable::GetDefaultBSphere ( ) const

Gets the collision volume bounding sphere.

Returns
The collision volume bounding sphere.
Here is the caller graph for this function:

◆ GetGroupRef()

CollidableGroup::CollidableCollectionRef & Collidable::GetGroupRef ( )
private

Gets the group reference for the GameObject.

Returns
Reference to the collidable group collection iterator.

◆ SetCollidableGroup()

template<typename C>
void Collidable::SetCollidableGroup ( )
inlineprotected

Sets the collidable group for the object.

Template Parameters
CThe type of the collidable group.
Here is the call graph for this function:

◆ SetColliderModel()

void Collidable::SetColliderModel ( Model * mod,
VolumeType v )
protected

Sets the collider model for the GameObject.

Parameters
modPointer to the model.
Here is the call graph for this function:

◆ UpdateCollisionData()

void Collidable::UpdateCollisionData ( const Matrix & mat)
protected

Updates the collision data for the GameObject.

Parameters
matThe transformation matrix.
Here is the call graph for this function:

◆ UpdateDefaultBSphere()

void Collidable::UpdateDefaultBSphere ( const Matrix & mat)
private

Updates the default bounding sphere for the collidable object.

Parameters
matThe transformation matrix.
Here is the caller graph for this function:

◆ VisualizeCollisionVolume()

void Collidable::VisualizeCollisionVolume ( VolumeType t,
const Vect & color ) const
protected

Sets the color of the bounding sphere for visualization.

Parameters
colThe color to set.
Here is the call graph for this function:

◆ VisualizeDefaultBSphere()

void Collidable::VisualizeDefaultBSphere ( const Vect & color) const
protected

Sets the default bounding sphere color for the collidable object.

Parameters
colThe color to set.
Here is the call graph for this function:

The documentation for this class was generated from the following files: