![]() |
Rendering Engine 0.2.0
Modular Graphics Rendering Engine | v0.2.0
|
Represents a 3D perspective camera with world transform and projection settings. More...
#include <camera.hpp>
Public Member Functions | |
| Camera (IApplication &app) | |
| Constructs a camera for the given application context. | |
| virtual | ~Camera ()=default |
| Virtual destructor. | |
| virtual void | Initialize () |
| Initializes camera parameters and matrices. | |
| virtual void | Update (float deltaTime) |
| Updates camera logic, recalculates view/projection matrices as needed. | |
| void | SetPosition (const glm::vec3 &position) |
| Sets the camera position in world space. | |
| void | SetRotation (const glm::quat &rotation) |
| Sets the camera rotation via quaternion. | |
| void | SetRotation (const glm::vec3 &rotation) |
| Sets the camera rotation via Euler angles (degrees). | |
| glm::vec3 | GetPosition () const |
| Gets the camera position. | |
| glm::quat | GetRotationQuat () const |
| Gets the camera rotation as a quaternion. | |
| glm::vec3 | GetRotation () const |
| Gets the camera rotation as Euler angles (degrees). | |
| glm::vec3 | GetForward () const |
| Gets the camera's forward direction vector. | |
| glm::vec3 | GetUp () const |
| Gets the camera's up direction vector. | |
| glm::vec3 | GetRight () const |
| Gets the camera's right direction vector. | |
| const glm::mat4 & | ViewMatrix () const |
| Gets the camera view matrix. | |
| const glm::mat4 & | ProjectionMatrix () const |
| Gets the camera projection matrix. | |
| glm::mat4 | ViewProjectionMatrix () const |
| Gets the combined view-projection matrix. | |
| void | Reset () |
| Resets the camera to the default position and rotation. | |
| void | UpdateProjectionMatrix () |
| Updates the camera's projection matrix (based on FOV, aspect, near/far). | |
| void | UpdateViewMatrix () |
| Updates the camera's view matrix (based on position/orientation). | |
| Camera (const Camera &rhs)=delete | |
| Camera & | operator= (const Camera &rhs)=delete |
Protected Attributes | |
| IApplication & | mApp |
| std::unique_ptr< SceneComponent > | mSceneComponent |
| glm::mat4 | mViewMatrix |
| glm::mat4 | mProjectionMatrix |
| float | mFieldOfView |
| float | mAspectRatio |
| float | mNearPlaneDistance |
| float | mFarPlaneDistance |
Static Protected Attributes | |
| static const float | sDefaultFieldOfView = 45.0f |
| static const float | sDefaultAspectRatio |
| static const float | sDefaultNearPlaneDistance = 0.01f |
| static const float | sDefaultFarPlaneDistance = 1000.0f |
Represents a 3D perspective camera with world transform and projection settings.
The Camera defines the viewpoint in the 3D scene, including position and orientation (via a SceneComponent) and projection parameters (field of view, aspect ratio, near/far planes). The camera supports standard view matrix construction using GLM and can be subclassed for additional camera types (third-person, orbit, etc).
The rendering engine uses a left-handed coordinate system:
By default, the camera looks along the world Y+ direction after Reset().
Definition at line 47 of file camera.hpp.
| rendering_engine::Camera::Camera | ( | IApplication & | app | ) |
Constructs a camera for the given application context.
| app | Reference to the IApplication (for screen settings, etc.). |
Definition at line 12 of file camera.cpp.
|
virtualdefault |
Virtual destructor.
|
delete |
| glm::vec3 rendering_engine::Camera::GetForward | ( | ) | const |
Gets the camera's forward direction vector.
Definition at line 59 of file camera.cpp.
| glm::vec3 rendering_engine::Camera::GetPosition | ( | ) | const |
Gets the camera position.
Definition at line 47 of file camera.cpp.
| glm::vec3 rendering_engine::Camera::GetRight | ( | ) | const |
Gets the camera's right direction vector.
Definition at line 67 of file camera.cpp.
| glm::vec3 rendering_engine::Camera::GetRotation | ( | ) | const |
Gets the camera rotation as Euler angles (degrees).
Definition at line 55 of file camera.cpp.
| glm::quat rendering_engine::Camera::GetRotationQuat | ( | ) | const |
Gets the camera rotation as a quaternion.
Definition at line 51 of file camera.cpp.
| glm::vec3 rendering_engine::Camera::GetUp | ( | ) | const |
Gets the camera's up direction vector.
Definition at line 63 of file camera.cpp.
|
virtual |
Initializes camera parameters and matrices.
Definition at line 24 of file camera.cpp.
| const glm::mat4 & rendering_engine::Camera::ProjectionMatrix | ( | ) | const |
| void rendering_engine::Camera::Reset | ( | ) |
Resets the camera to the default position and rotation.
Definition at line 83 of file camera.cpp.
| void rendering_engine::Camera::SetPosition | ( | const glm::vec3 & | position | ) |
Sets the camera position in world space.
| position | New position (glm::vec3). |
Definition at line 35 of file camera.cpp.
| void rendering_engine::Camera::SetRotation | ( | const glm::quat & | rotation | ) |
Sets the camera rotation via quaternion.
| rotation | New rotation (glm::quat). |
Definition at line 39 of file camera.cpp.
| void rendering_engine::Camera::SetRotation | ( | const glm::vec3 & | rotation | ) |
Sets the camera rotation via Euler angles (degrees).
| rotation | Euler angles (pitch, yaw, roll), in degrees. |
Definition at line 43 of file camera.cpp.
|
virtual |
Updates camera logic, recalculates view/projection matrices as needed.
| deltaTime | Elapsed time since last update (seconds). |
Definition at line 30 of file camera.cpp.
| void rendering_engine::Camera::UpdateProjectionMatrix | ( | ) |
Updates the camera's projection matrix (based on FOV, aspect, near/far).
Definition at line 89 of file camera.cpp.
| void rendering_engine::Camera::UpdateViewMatrix | ( | ) |
Updates the camera's view matrix (based on position/orientation).
Definition at line 95 of file camera.cpp.
| const glm::mat4 & rendering_engine::Camera::ViewMatrix | ( | ) | const |
Gets the camera view matrix.
Definition at line 71 of file camera.cpp.
| glm::mat4 rendering_engine::Camera::ViewProjectionMatrix | ( | ) | const |
Gets the combined view-projection matrix.
Definition at line 79 of file camera.cpp.
|
protected |
Definition at line 154 of file camera.hpp.
|
protected |
Definition at line 167 of file camera.hpp.
|
protected |
Definition at line 169 of file camera.hpp.
|
protected |
Definition at line 166 of file camera.hpp.
|
protected |
Definition at line 168 of file camera.hpp.
|
protected |
Definition at line 159 of file camera.hpp.
|
protected |
Definition at line 156 of file camera.hpp.
|
protected |
Definition at line 158 of file camera.hpp.
|
staticprotected |
Definition at line 162 of file camera.hpp.
|
staticprotected |
Definition at line 164 of file camera.hpp.
|
staticprotected |
Definition at line 161 of file camera.hpp.
|
staticprotected |
Definition at line 163 of file camera.hpp.