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

Base class for all GameObjects in the engine. More...

#include <GameObject.h>

Inheritance diagram for GameObject:
Inheritance graph

Public Member Functions

bool IsRegistered () const
 Checks if the GameObject is registered in the scene.
 
bool IsPendingRegistration () const
 Checks if the GameObject is pending registration in the scene.
 
bool IsPendingDeregistration () const
 Checks if the GameObject is pending deregistration in the scene.
 
- Public Member Functions inherited from Collidable
const CollisionVolumeGetCollisionVolume ()
 Gets the collision volume bounding sphere.
 
const CollisionVolumeBSphereGetDefaultBSphere () const
 Gets the collision volume bounding sphere.
 

Protected Member Functions

 GameObject (const GameObject &)=delete
 
GameObjectoperator= (const GameObject &)=delete
 
void SubmitEntry ()
 Submits the entry command for the GameObject.
 
void SubmitExit ()
 Submits the exit command for the GameObject.
 
virtual void CollisionTerrain ()
 Sets the entry command for the GameObject.
 
- Protected Member Functions inherited from Alarmable
 Alarmable (const Alarmable &)=delete
 
Alarmableoperator= (const Alarmable &)=delete
 
void SubmitAlarmRegistration (AlarmableManager::ALARM_ID id, float t)
 Submits the alarm registration for the GameObject.
 
void SubmitAlarmDeregistration (AlarmableManager::ALARM_ID id)
 Submits the alarm deregistration for the GameObject.
 
bool IsAlarmRegistered (AlarmableManager::ALARM_ID id)
 Checks if the given alarm is currently registered.
 
- Protected Member Functions inherited from Collidable
 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.
 
- Protected Member Functions inherited from Drawable
 Drawable (const Drawable &)=delete
 
Drawableoperator= (const Drawable &)=delete
 
void SubmitDrawRegistration ()
 Submits the draw registration for the GameObject.
 
void SubmitDrawDeregistration ()
 Submits the draw deregistration for the GameObject.
 
- Protected Member Functions inherited from Inputable
 Inputable (const Inputable &)=delete
 
Inputableoperator= (const Inputable &)=delete
 
void SubmitKeyRegistration (AZUL_KEY k, EventType e)
 Submits the key registration for the GameObject.
 
void SubmitKeyDeregistration (AZUL_KEY k, EventType e)
 Submits the key deregistration for the GameObject.
 
void SubmitMouseKeyRegistration (AZUL_MOUSE m, EventType e)
 Submits the mouse key registration for the GameObject.
 
void SubmitMouseKeyDeregistration (AZUL_MOUSE m, EventType e)
 Submits the mouse key deregistration for the GameObject.
 
- Protected Member Functions inherited from Updatable
 Updatable (const Updatable &)=delete
 
Updatableoperator= (const Updatable &)=delete
 
void SubmitUpdateRegistration ()
 Submits the update registration for the GameObject.
 
void SubmitUpdateDeregistration ()
 Submits the update deregistration for the GameObject.
 

Private Member Functions

void ConnectToScene ()
 Connects the GameObject to the scene.
 
virtual void SceneEntry ()=0
 Called when the GameObject enters the scene; used for registration management, called by system on entry and user by request.
 
void DisconnectFromScene ()
 Disconnects the GameObject from the scene.
 
virtual void SceneExit ()
 Called when the GameObject exits the scene; used for registration management, called by user.
 

Private Attributes

RegistrationState currState
 The current registration state of the GameObject.
 
GameObjectEntryCommandptrEntryCmd
 Pointer to the entry command for the GameObject.
 
GameObjectExitCommandptrExitCmd
 Pointer to the exit command for the GameObject.
 

Friends

class GameObjectAttorney
 

Detailed Description

Base class for all GameObjects in the engine.

The GameObject class serves as the base class for all GameObjects in the engine. It provides methods for scene entry, scene exit, and connection to the scene. It also manages the registration state of the GameObject.

Member Function Documentation

◆ CollisionTerrain()

virtual void GameObject::CollisionTerrain ( )
inlineprotectedvirtual

Sets the entry command for the GameObject.

Parameters
cmdPointer to the GameObjectEntryCommand to set.

◆ IsPendingDeregistration()

bool GameObject::IsPendingDeregistration ( ) const

Checks if the GameObject is pending deregistration in the scene.

Returns
True if the GameObject is pending deregistration, false otherwise.

◆ IsPendingRegistration()

bool GameObject::IsPendingRegistration ( ) const

Checks if the GameObject is pending registration in the scene.

Returns
True if the GameObject is pending registration, false otherwise.

◆ IsRegistered()

bool GameObject::IsRegistered ( ) const

Checks if the GameObject is registered in the scene.

Returns
True if the GameObject is registered, false otherwise.

◆ SceneEntry()

virtual void GameObject::SceneEntry ( )
privatepure virtual

Called when the GameObject enters the scene; used for registration management, called by system on entry and user by request.

Implemented in FreeCamera.

Here is the caller graph for this function:

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