struct
CameraComponent
- Module
- Camera
- Header
#include "Camera/Components/CameraComponent.h"- Namespace
Mowo- Reflection
- Reflected by MowoHeaderTool
Properties
| Type | Name | Description |
|---|---|---|
bool | enabled | Default true. |
CameraProjectionType | projectionType | Default CameraProjectionType::Perspective. |
float | fieldOfView | Perspective settings Default CameraDefaults::DefaultFOV. |
float | orthographicSize | Orthographic settings Default CameraDefaults::DefaultOrthoSize. |
float | nearPlane | Default CameraDefaults::DefaultNearPlane. |
float | farPlane | Default CameraDefaults::DefaultFarPlane. |
float | aspectRatio | Default CameraDefaults::DefaultAspect. |
float | viewportX | Viewport region of the final output (normalized 0-1). Default (0, 0, 1, 1) covers the whole output — the common single-camera case. For split-screen left/right use (0, 0, 0.5, 1) and (0.5, 0, 0.5, 1); for picture-in-picture put the inset camera at something like (0.7, 0.7, 0.3, 0.3). Default 0.0f. |
float | viewportY | Default 0.0f. |
float | viewportWidth | Default 1.0f. |
float | viewportHeight | Default 1.0f. |
int | renderOrder | Render order — cameras are rendered low → high; later cameras overdraw earlier ones in any overlapping viewport region. Useful for PiP (background = order 0, inset = order 1) and for layering UI-camera passes that share the same viewport. Default 0. |
Vec3 | clearColor | Default Vec3(0.2f, 0.2f, 0.2f). |
bool | isMain | Is this the main camera? Default false. |
bool | clearColorBuffer | Clear color on render Default true. |
bool | clearDepthBuffer | Clear depth on render Default true. |
uint32_t | cullingMask | Layer culling mask (renders entities whose layer bit is set) Default 0xFFFFFFFF. |
Public functions
| Returns | Name | Description |
|---|---|---|
Mat4 | GetViewMatrix | Matrices (computed from transform + settings) |
Mat4 | GetProjectionMatrix | |
Vec2 | WorldToScreen | |
Ray | ScreenToWorldRay |
Function details
GetViewMatrix
C++
Mat4 GetViewMatrix(const Vec3& position, const Vec3& forward, const Vec3& up) constMatrices (computed from transform + settings)
GetProjectionMatrix
C++
Mat4 GetProjectionMatrix() constWorldToScreen
C++
Vec2 WorldToScreen(const Vec3& worldPos, const Vec3& cameraPos, const Vec3& cameraForward, const Vec3& cameraUp, const Vec2& screenSize) constScreenToWorldRay
C++
Ray ScreenToWorldRay(const Vec2& screenPos, const Vec3& cameraPos, const Vec3& cameraForward, const Vec3& cameraUp, const Vec2& screenSize) constGenerated from Camera/Components/CameraComponent.h via camera.json · Oct 26, 2026Version 1.0.0