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
CameraSoA Struct Reference

Structure of Arrays representing camera components for parallel view projection calculations. More...

#include <CameraSoA.hpp>

Public Member Functions

void clear ()
 Clears all arrays.
size_t pushCamera (float fov, float aspect, float nearPlane, float farPlane, bool isOrthographic=false, float orthoSize=5.0f)
 Adds camera components to SoA.
size_t size () const
 Returns total camera count.
template<typename TransformSoAType>
void updateViewProjections (const TransformSoAType &transforms)
 Batch updates view projection matrices.

Public Attributes

std::vector< bool > isOrthographics
std::vector< float > orthoSizes
std::vector< float > fovs
 Fields of view in degrees.
std::vector< float > aspects
 Viewport aspect ratios.
std::vector< float > nearPlanes
 Distances to near clipping planes.
std::vector< float > farPlanes
 Distances to far clipping planes.
std::vector< glm::mat4 > viewProjMatrices
 Computed view-projection matrices ready for GPU transfer.

Detailed Description

Structure of Arrays representing camera components for parallel view projection calculations.

Member Function Documentation

◆ clear()

void CameraSoA::clear ( )
inline

Clears all arrays.

◆ pushCamera()

size_t CameraSoA::pushCamera ( float fov,
float aspect,
float nearPlane,
float farPlane,
bool isOrthographic = false,
float orthoSize = 5.0f )
inline

Adds camera components to SoA.

Parameters
fovField of view.
aspectAspect ratio.
nearPlaneNear plane.
farPlaneFar plane.
isOrthographicWhether camera is orthographic.
orthoSizeOrthographic vertical size.
Returns
Index of the new camera data.

◆ size()

size_t CameraSoA::size ( ) const
inline

Returns total camera count.

Returns
Camera count.

◆ updateViewProjections()

template<typename TransformSoAType>
void CameraSoA::updateViewProjections ( const TransformSoAType & transforms)
inline

Batch updates view projection matrices.

Template Parameters
TransformSoATypeClass representing transform array.
Parameters
transformsThe transform list matching camera indexes.

Member Data Documentation

◆ aspects

std::vector<float> CameraSoA::aspects

Viewport aspect ratios.

◆ farPlanes

std::vector<float> CameraSoA::farPlanes

Distances to far clipping planes.

◆ fovs

std::vector<float> CameraSoA::fovs

Fields of view in degrees.

◆ isOrthographics

std::vector<bool> CameraSoA::isOrthographics

◆ nearPlanes

std::vector<float> CameraSoA::nearPlanes

Distances to near clipping planes.

◆ orthoSizes

std::vector<float> CameraSoA::orthoSizes

◆ viewProjMatrices

std::vector<glm::mat4> CameraSoA::viewProjMatrices

Computed view-projection matrices ready for GPU transfer.


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