rigComponent 0.1.1
RigKit pack API - rigComponent
Loading...
Searching...
No Matches
rigkit::ecs::CCamera Struct Reference

Portable camera POD - optics plus present chrome. More...

#include <rigComponent/src/CCamera.h>

Public Types

enum class  Shade : int
 Present shade. Wireframe is see-through edges; Sketch hides occluded edges.

Public Member Functions

void resetToDefaults ()
 Restore optics defaults (FOV, clips, projection).

Static Public Member Functions

static glm::mat4 viewMatrix (const CTransform &transform)
 View from hierarchy world pose (call after SHierarchy).
static bool projectToViewport (const CCamera &cam, const CTransform &camXf, glm::vec3 world, float viewW, float viewH, glm::vec2 &outPx)
 Project a world point into viewport pixels (origin top-left).

Public Attributes

float fovYDegrees = 45.0f
 Vertical field of view in degrees (perspective).
float orthoHeight = 10.0f
 Full vertical size in world units (orthographic).
bool infiniteFar = false
 Perspective only: far plane at infinity (farClip ignored).
float aspect = 0.0f
 0 = use viewport aspect at present time.
int presentWidth = 0
 Low-res present size (0 = full window). Nearest-upscaled by rigRender3D.

Detailed Description

Portable camera POD - optics plus present chrome.

Pose lives on CTransform (same entity). Speaks rig.spatial.camera. rigRender3D builds view from CTransform::world and projection from these fields. presentWidth / presentHeight / shade are present choices, not optics. No GPU handles.

Member Function Documentation

◆ projectToViewport()

bool rigkit::ecs::CCamera::projectToViewport ( const CCamera & cam,
const CTransform & camXf,
glm::vec3 world,
float viewW,
float viewH,
glm::vec2 & outPx )
inlinestatic

Project a world point into viewport pixels (origin top-left).

Returns
false when the point is behind the camera (clip.w near zero).

◆ resetToDefaults()

void rigkit::ecs::CCamera::resetToDefaults ( )
inline

Restore optics defaults (FOV, clips, projection).

Keeps Active and present chrome (lo-res size, shade).

Member Data Documentation

◆ infiniteFar

bool rigkit::ecs::CCamera::infiniteFar = false

Perspective only: far plane at infinity (farClip ignored).

Stops distant CAD wires dropping out when the bed spans metres and near is small.


The documentation for this struct was generated from the following file:
  • packs/rigComponent/src/CCamera.h