Wraith
0.1.5
Basic 3D game engine in C++
|
For collision of GameObject entity tested every frame. NOTE: GameObject Entity must be registered in order to process collision callback. More...
Enumerations | |
enum class | Collidable::VolumeType { BSPHERE , AABB , OBB } |
Values that represent volume types. More... | |
enum class | Collidable::VolumeHierarchyType { OCTREE } |
Values that represent volume hierarchy htypes. More... | |
Functions | |
virtual void | Collidable::terrainCollision () |
Terrain collision callback for this object. More... | |
void | Collidable::setColliderModel (Model *pColliderModel, VolumeType volumeType) |
Sets collider model and Collision Volume type. More... | |
void | Collidable::setColliderModel (Model *pColliderModel, VolumeHierarchyType volumeHierarchyType, int maxDepth) |
Sets collider model and Collision Volume Hierarchy type. More... | |
void | Collidable::updateCollisionData (const Matrix &world) |
Updates the collision data described by world matrix. More... | |
template<class UserClass > | |
void | Collidable::setCollidableGroup () |
Sets collidable group. More... | |
void | Collidable::submitCollisionRegistration () |
Submit collision registration to current scene. More... | |
void | Collidable::submitCollisionDeregistration () |
Submit collision deregistration. More... | |
bool | Collidable::isRegisteredForCollisions () const |
Query if this object is registered for collisions. More... | |
For collision of GameObject entity tested every frame. NOTE: GameObject Entity must be registered in order to process collision callback.
Collisions are a way for game objects to interact with each other on a virtual physical level.
You set up the colliders by passing in the collider model (which is just an ordinary model) and calling
Here is an example of setting up collision callbacks of tank, bullet, warehouse, wind mill, and tree game object. As well as how an enitity would interact with Terrain collisions.
NOTE: This is simply to set the callbacks for collisions and not to set up the collision tests. NOTE: The use of an octree uses the VolumeHiearchyType::OCTREE instead of VolumeType (only for BSphsere, AABB, and OBB)
That must be done within a user derived Scene entity in the Scene::initialize().
Using Collision Volume Octree has some slight difference such as using a difference enum type VolumeHierarchyType::OCTREE and GameObject::setColliderModel() taking an extra paremeter max depth. IMPORTANT: The depth value must be greater than or equal to 1. Anything less will result in a error.
|
strong |
Values that represent volume hierarchy htypes.
To be used in GameObject::setColliderModel(). Currently there is Collidable::VolumeHierarchyType::OCTREE
|
strong |
Values that represent volume types.
To be used in GameObject::setColliderModel(). Currently there is Collidable::VolumeType::BSPHERE, Collidable::VolumeType::AABB, and Collidable::VolumeType::OBB
|
protected |
Query if this object is registered for collisions.
|
inlineprotected |
Sets collidable group.
Must be called when the GameObject enters the scene for the first time and will use collisions.
UserClass | Type of the user class. |
|
protected |
Sets collider model and Collision Volume Hierarchy type.
MUST be set if collisions are to be used.
pColliderModel | pointer to a collider model. |
volumeType | collision volume type to be used. |
maxDepth | The maximum depth of volume hierarchy. |
|
protected |
Sets collider model and Collision Volume type.
MUST be set if collisions are to be used.
pColliderModel | pointer to a collider model. |
volumeType | collision volume type to be used. |
|
protected |
Submit collision deregistration.
|
protected |
Submit collision registration to current scene.
|
virtual |
Terrain collision callback for this object.
To be implemented by user in object derived from GameObject (NOT directly derived from Collidable). Called ONLY by current active scene.
|
protected |
Updates the collision data described by world matrix.
Must be called whenever the world matrix has changed.
world | The world. |