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

Represents a free-moving camera in the scene. More...

#include <FreeCamera.h>

Inheritance diagram for FreeCamera:
Inheritance graph

Public Member Functions

 FreeCamera (const FreeCamera &)=delete
 
FreeCameraoperator= (const FreeCamera &)=delete
 
- Public Member Functions inherited from GameObject
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.
 

Public Attributes

Camera * freeCam
 

Private Member Functions

void SceneEntry () override
 Called when the GameObject enters the scene; used for registration management, called by system on entry and user by request.
 
void KeyHeld (AZUL_KEY k) override
 Virtual method to be implemented by derived classes for key held functionality.
 
void KeyPress (AZUL_KEY k) override
 Virtual method to be implemented by derived classes for key press functionality.
 

Private Attributes

Matrix camRot
 
Vect camUp
 
Vect camLookAt
 
Vect camPos
 
Vect camDir
 
float camTranSpeed
 
float camRotSpeed
 

Additional Inherited Members

- Protected Member Functions inherited from GameObject
 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.
 

Detailed Description

Represents a free-moving camera in the scene.

The FreeCamera class is a type of GameObject that represents a camera which can move freely in the scene. It provides methods for scene entry, scene exit, and handling key inputs to control the camera. Moves the camera based on key inputs, KEY_MINUS and KEY_EQUAL for backward and forward movement, and arrow keys for rotation.

Member Function Documentation

◆ KeyHeld()

void FreeCamera::KeyHeld ( AZUL_KEY k)
overrideprivatevirtual

Virtual method to be implemented by derived classes for key held functionality.

Parameters
kThe key that is held.

Reimplemented from Inputable.

◆ KeyPress()

void FreeCamera::KeyPress ( AZUL_KEY k)
overrideprivatevirtual

Virtual method to be implemented by derived classes for key press functionality.

Parameters
kThe key that is pressed.

Reimplemented from Inputable.

◆ SceneEntry()

void FreeCamera::SceneEntry ( )
overrideprivatevirtual

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

Implements GameObject.

Here is the call graph for this function:

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