Structure of Arrays representing camera components for parallel view projection calculations.
More...
#include <CameraSoA.hpp>
|
| 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.
|
|
| 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.
|
Structure of Arrays representing camera components for parallel view projection calculations.
◆ clear()
| void CameraSoA::clear |
( |
| ) |
|
|
inline |
◆ 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
-
| fov | Field of view. |
| aspect | Aspect ratio. |
| nearPlane | Near plane. |
| farPlane | Far plane. |
| isOrthographic | Whether camera is orthographic. |
| orthoSize | Orthographic 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
-
| TransformSoAType | Class representing transform array. |
- Parameters
-
| transforms | The transform list matching camera indexes. |
◆ aspects
| std::vector<float> CameraSoA::aspects |
◆ 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: