Camera
This class is not intended to be used directly. Use PerspectiveCamera or OrthographicCamera unless you are defining your own camera type, in which case it should inherit from this class.
INFO
Derives from Node and inherits all public properties and methods.
Properties
Projection matrix that maps camera-space coordinates to clip space.
View matrix that maps world space to camera space.
Functions
Frustum vglx::Camera::GetFrustum()
Computes a Frustum from the combined projection and view matrices. Useful for applying frustum culling to renderable nodes.
GetNodeType() Node::Type virtual
Node::Type vglx::Camera::GetNodeType() const override
Identifies this node as a camera. Always returns Node::Type::Camera, allowing runtime checks to distinguish camera nodes from other node types.
LookAt() void virtual
void vglx::Camera::LookAt(const Vector3 &target) override
Parameter | Description |
---|---|
target | World-space position for the camera to look at. |
Overrides Node::LookAt to orient the camera toward a world-space target. Accounts for the camera’s -Z viewing direction so the camera faces the given point.
Resize() void pure virtual
virtual void vglx::Camera::Resize(int width, int height)=0
Parameter | Description |
---|---|
width | Viewport width in pixels. |
height | Viewport height in pixels. |
Updates projection_matrix to reflect the current viewport size. Must be implemented by derived cameras to apply the appropriate projection logic.
UpdateViewMatrix() void
void vglx::Camera::UpdateViewMatrix()
Sets view_matrix to the inverse of the camera's world transform. Called internally by the renderer before rendering a frame; manual calls are rarely necessary.