|
|
PixelBullet
0.0.1
A C++ game engine
|
A base 3D camera class with perspective projection. More...
#include <Camera.hpp>
Public Member Functions | |
| Camera (float fov=glm::radians(45.0f), float nearPlane=0.1f, float farPlane=1000.0f) | |
| Constructs a camera with a perspective projection. | |
| virtual void | Start () |
| virtual void | Update () |
| void | SetPosition (const glm::vec3 &pos) |
| Sets world position and recalculates the view matrix. | |
| void | SetRotation (const glm::vec3 &rotEuler) |
| Sets rotation in Euler angles (degrees), recalculates view matrix. | |
| void | SetPerspective (float fov, float aspect, float nearPlane, float farPlane) |
| Sets the perspective projection matrix. | |
| float | GetFOV () const |
| float | GetNearPlane () const |
| float | GetFarPlane () const |
| const glm::vec3 & | GetPosition () const |
| const glm::vec3 & | GetRotationEuler () const |
| const glm::mat4 & | GetViewMatrix () const |
| const glm::mat4 & | GetProjectionMatrix () const |
| glm::vec3 | GetForward () const |
| glm::vec3 | GetRight () const |
| glm::vec3 | GetUp () const |
Protected Member Functions | |
| glm::quat | GetRotationQuat () const |
| void | RecalculateView () |
Protected Attributes | |
| float | m_FOV |
| Field of view in radians. | |
| float | m_Near |
| Near clipping plane. | |
| float | m_Far |
| Far clipping plane. | |
| glm::vec3 | m_Position |
| World-space position. | |
| glm::vec3 | m_RotationEuler |
| Rotation in degrees (pitch, yaw, roll). | |
| glm::mat4 | m_ViewMatrix |
| View matrix. | |
| glm::mat4 | m_ProjectionMatrix |
| Projection matrix. | |
A base 3D camera class with perspective projection.
Stores transform data (position + rotation), and calculates view/projection matrices. Extend this class to implement specific behaviors like FPS or orbital cameras.
|
inlineexplicit |
Constructs a camera with a perspective projection.
| fov | Field of view in radians. |
| nearPlane | Near clipping distance. |
| farPlane | Far clipping distance. |
|
inline |
Sets the perspective projection matrix.
| fov | Field of view in radians. |
| aspect | Aspect ratio (width / height). |
| nearPlane | Near clipping plane. |
| farPlane | Far clipping plane. |
|
inline |
Sets world position and recalculates the view matrix.
|
inline |
Sets rotation in Euler angles (degrees), recalculates view matrix.
|
protected |
Far clipping plane.
|
protected |
Field of view in radians.
|
protected |
Near clipping plane.
|
protected |
World-space position.
|
protected |
Projection matrix.
|
protected |
Rotation in degrees (pitch, yaw, roll).
|
protected |
View matrix.