Crimson Engine 1.0.0
A high-performance C++20 game engine prototype showcasing a custom ECS, Vulkan renderer, and ImGui editor.
Loading...
Searching...
No Matches
Camera Struct Reference

Represents a camera component for rendering and viewing. More...

#include <Camera.hpp>

Public Member Functions

glm::mat4 view (const Transform &transform) const
 Calculates the view matrix based on the given transform.
glm::mat4 projection () const
 Calculates the projection matrix.
glm::mat4 viewProjection (const Transform &transform) const
 Calculates the view-projection matrix.

Public Attributes

bool isOrthographic = false
 True if camera projection mode is Orthographic, false if Perspective.
float orthoSize = 5.0f
 Vertical half-height size in world units when in Orthographic projection mode.
float fov = 45.f
 Vertical Field of View in degrees when in Perspective projection mode.
float aspect = 1.0f
 Viewport aspect ratio (width / height).
float nearPlane = 0.1f
 Distance to near clipping plane.
float farPlane = 100.f
 Distance to far clipping plane.
float moveSpeed = 5.f
 Movement speed multiplier (units/sec) for camera fly controls.
float mouseSensitivity = 0.1f
 Mouse look sensitivity multiplier.

Detailed Description

Represents a camera component for rendering and viewing.

Member Function Documentation

◆ projection()

glm::mat4 Camera::projection ( ) const
inline

Calculates the projection matrix.

Returns
The 4x4 projection matrix.

◆ view()

glm::mat4 Camera::view ( const Transform & transform) const
inline

Calculates the view matrix based on the given transform.

Parameters
transformThe transform of the camera entity.
Returns
The 4x4 view matrix.

◆ viewProjection()

glm::mat4 Camera::viewProjection ( const Transform & transform) const
inline

Calculates the view-projection matrix.

Parameters
transformThe transform of the camera entity.
Returns
The 4x4 view-projection matrix.

Member Data Documentation

◆ aspect

float Camera::aspect = 1.0f

Viewport aspect ratio (width / height).

◆ farPlane

float Camera::farPlane = 100.f

Distance to far clipping plane.

◆ fov

float Camera::fov = 45.f

Vertical Field of View in degrees when in Perspective projection mode.

◆ isOrthographic

bool Camera::isOrthographic = false

True if camera projection mode is Orthographic, false if Perspective.

◆ mouseSensitivity

float Camera::mouseSensitivity = 0.1f

Mouse look sensitivity multiplier.

◆ moveSpeed

float Camera::moveSpeed = 5.f

Movement speed multiplier (units/sec) for camera fly controls.

◆ nearPlane

float Camera::nearPlane = 0.1f

Distance to near clipping plane.

◆ orthoSize

float Camera::orthoSize = 5.0f

Vertical half-height size in world units when in Orthographic projection mode.


The documentation for this struct was generated from the following file: