Wraith  0.1.5
Basic 3D game engine in C++
GameObject Class Reference

A game object. Base class for all user defined game objects. Contains operations such as update, draw, input, and collision to be defined by the user. Also contains function to register or deregister specific game object related operations to the current scene. More...

#include <GameObject.h>

Inheritance diagram for GameObject:
Inheritance graph
Collaboration diagram for GameObject:
Collaboration graph

Public Member Functions

 GameObject ()
 Default constructor. More...
 
 GameObject (const GameObject &)=default
 
GameObjectoperator= (const GameObject &)=default
 
 GameObject (GameObject &&)=default
 
GameObjectoperator= (GameObject &&)=default
 
virtual ~GameObject ()
 Destructor. More...
 
void submitSceneEntry ()
 Submit scene entry to current scene. More...
 
void submitSceneExit ()
 Submit scene exit from current scene. More...
 
- Public Member Functions inherited from Updatable
 Updatable ()
 Default constructor. More...
 
 Updatable (const Updatable &)=default
 
Updatableoperator= (const Updatable &)=default
 
 Updatable (Updatable &&)=default
 
Updatableoperator= (Updatable &&)=default
 
- Public Member Functions inherited from Drawable
 Drawable (const Drawable &)=default
 
Drawableoperator= (const Drawable &)=default
 
 Drawable (Drawable &&)=default
 
Drawableoperator= (Drawable &&)=default
 
- Public Member Functions inherited from Alarmable
 Alarmable (const Alarmable &)=default
 
Alarmableoperator= (const Alarmable &)=default
 
 Alarmable (Alarmable &&)=default
 
Alarmableoperator= (Alarmable &&)=default
 
- Public Member Functions inherited from Inputable
 Inputable (const Inputable &)=default
 
Inputableoperator= (const Inputable &)=default
 
 Inputable (Inputable &&)=default
 
Inputableoperator= (Inputable &&)=default
 
- Public Member Functions inherited from Collidable
 Collidable (const Collidable &)=default
 
Collidableoperator= (const Collidable &)=default
 
 Collidable (Collidable &&)=default
 
Collidableoperator= (Collidable &&)=default
 
const CollisionVolumegetCollisionVolume () const
 Gets the current collsion volume being used. More...
 
const CollisionVolumeBSpheregetBSphere () const
 Gets the default BSphere. More...
 
virtual void terrainCollision ()
 Terrain collision callback for this object. More...
 

Private Member Functions

void connectToScene ()
 Connects to the current scene. More...
 
void disconnectFromScene ()
 Disconnects from the current scene. More...
 
virtual void sceneEntry ()
 A callback function for when a game object enters the scene . More...
 
virtual void sceneExit ()
 A callback function for when a game object exits the scene More...
 

Private Attributes

GameObjectEntryCommand_pGameObjectEntryCommand
 
GameObjectExitCommand_pGameObjectExitCommand
 
RegistrationState _currentRegistrationState
 

Friends

class GameObjectAttorney
 

Additional Inherited Members

- Public Types inherited from Collidable
enum class  VolumeType { BSPHERE , AABB , OBB }
 Values that represent volume types. More...
 
enum class  VolumeHierarchyType { OCTREE }
 Values that represent volume hierarchy htypes. More...
 
- Protected Member Functions inherited from Updatable
void submitUpdateRegistration ()
 Submit update registration to current scene. More...
 
void submitUpdateDeregistration ()
 Submit update deregistration to current scene. More...
 
bool isRegisteredForUpdate () const
 Query if this object is registered for update. More...
 
- Protected Member Functions inherited from Drawable
void submitDrawRegistration ()
 Submit draw registration to current scene. More...
 
void submitDrawDeregistration ()
 Submit draw deregistration to current scene. More...
 
void submitDraw2DRegistration ()
 Submit draw 2D registration to current scene. More...
 
void submitDraw2DDeregistration ()
 Submit draw 2D deregistration from current scene. More...
 
bool isRegisteredForDraw () const
 Query if this object is registered for draw. More...
 
bool isRegisteredForDraw2D () const
 Query if this object is registered for draw 2D. More...
 
- Protected Member Functions inherited from Alarmable
void submitAlarmRegistration (float timeDelay, AlarmID alarmID)
 Submit alarm registration to the current scene. More...
 
void submitAlarmDeregistration (AlarmID alarmID)
 Submit alarm deregistration to the current scene. More...
 
bool isRegisteredForAlarm (AlarmID alarmID) const
 Query if 'alarmID' is registered. More...
 
float getTimeLeftForAlarm (AlarmID alarmID) const
 Gets time left for a given alarm. More...
 
- Protected Member Functions inherited from Inputable
void submitKeyRegistration (AZUL_KEY key, InputEvent eventType)
 Submit key registration to current scene. More...
 
void submitKeyDeregistration (AZUL_KEY key, InputEvent eventType)
 Submit key deregistration to current scene. More...
 
bool isRegisterForKeyWithEvent (AZUL_KEY key, InputEvent eventType)
 Query if 'key' is register for key with event. More...
 
- Protected Member Functions inherited from Collidable
void setColliderModel (Model *pColliderModel, VolumeType volumeType)
 Sets collider model and Collision Volume type. More...
 
void setColliderModel (Model *pColliderModel, VolumeHierarchyType volumeHierarchyType, int maxDepth)
 Sets collider model and Collision Volume Hierarchy type. More...
 
void updateCollisionData (const Matrix &world)
 Updates the collision data described by world matrix. More...
 
template<class UserClass >
void setCollidableGroup ()
 Sets collidable group. More...
 
void submitCollisionRegistration ()
 Submit collision registration to current scene. More...
 
void submitCollisionDeregistration ()
 Submit collision deregistration. More...
 
bool isRegisteredForCollisions () const
 Query if this object is registered for collisions. More...
 

Detailed Description

A game object. Base class for all user defined game objects. Contains operations such as update, draw, input, and collision to be defined by the user. Also contains function to register or deregister specific game object related operations to the current scene.

remarks>

Constructor & Destructor Documentation

◆ GameObject()

GameObject::GameObject ( )

Default constructor.

Initializes its GameObjectEntryCommand and GameObjectExitCommand. Also sets its RegistrationState to RegistrationState::CURRENTLY_DEREGISTERED.


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