|
Estella 0.113.0
A fast 2D and 3D game engine powered by WebAssembly and ECS
|
Camera component for rendering viewpoints. More...
#include <Camera.hpp>
Public Member Functions | |
| Camera ()=default | |
Public Attributes | |
| ProjectionType | projectionType {ProjectionType::Perspective} |
| Projection type. | |
| f32 | fov {60.0f} |
| Field of view in degrees (perspective only). | |
| f32 | orthoSize {5.0f} |
| Orthographic size (half-height in world units). | |
| f32 | nearPlane {0.1f} |
| Near clipping plane distance. | |
| f32 | farPlane {1000.0f} |
| Far clipping plane distance. | |
| f32 | aspectRatio {0.0f} |
| Aspect ratio (width / height), 0 = auto from viewport. | |
| bool | isActive {false} |
| Whether this is the active camera. | |
| i32 | priority {0} |
| Priority for determining active camera (higher = preferred). | |
| glm::vec4 | viewport {0.0f, 0.0f, 1.0f, 1.0f} |
| Viewport rectangle (x, y, width, height) in normalized coords. | |
| ClearFlags | clearFlags {ClearFlags::ColorAndDepth} |
| bool | pixelPerfect {false} |
| Snap the camera to the world-space pixel grid (Orthographic) so static pixel art renders crisp, without sub-pixel shimmer when the camera moves. | |
| u32 | cullingMask {0xFFFFFFFFu} |
| Sorting layers this camera renders (bit i = layer i). UI belongs to its Canvas' layer. Layers outside 0..31 have no bit and every camera draws them. | |
| u32 | renderTarget {0} |
| Offscreen target this camera draws into; 0 = the screen. A RenderTexture handle, so it is created at run time and set from a script — a minimap, a mirror, a portrait rendered once. The camera's viewport covers the whole target, whose own size decides the resolution. | |
Camera component for rendering viewpoints.
Defines a camera that can be used to render the scene. Supports both perspective and orthographic projections.
Definition at line 70 of file Camera.hpp.
|
default |
| f32 esengine::ecs::Camera::aspectRatio {0.0f} |
Aspect ratio (width / height), 0 = auto from viewport.
Definition at line 94 of file Camera.hpp.
Referenced by cameraApplyJS(), and cameraToJS().
| ClearFlags esengine::ecs::Camera::clearFlags {ClearFlags::ColorAndDepth} |
Definition at line 111 of file Camera.hpp.
Referenced by cameraApplyJS(), and cameraToJS().
| u32 esengine::ecs::Camera::cullingMask {0xFFFFFFFFu} |
Sorting layers this camera renders (bit i = layer i). UI belongs to its Canvas' layer. Layers outside 0..31 have no bit and every camera draws them.
Definition at line 122 of file Camera.hpp.
Referenced by cameraApplyJS(), and cameraToJS().
| f32 esengine::ecs::Camera::farPlane {1000.0f} |
Far clipping plane distance.
Definition at line 90 of file Camera.hpp.
Referenced by cameraApplyJS(), and cameraToJS().
| f32 esengine::ecs::Camera::fov {60.0f} |
Field of view in degrees (perspective only).
Definition at line 77 of file Camera.hpp.
Referenced by cameraApplyJS(), and cameraToJS().
| bool esengine::ecs::Camera::isActive {false} |
Whether this is the active camera.
Definition at line 98 of file Camera.hpp.
Referenced by cameraApplyJS(), cameraToJS(), and esengine::particle::ParticleSystem::update().
| f32 esengine::ecs::Camera::nearPlane {0.1f} |
Near clipping plane distance.
Definition at line 86 of file Camera.hpp.
Referenced by cameraApplyJS(), and cameraToJS().
| f32 esengine::ecs::Camera::orthoSize {5.0f} |
Orthographic size (half-height in world units).
Definition at line 82 of file Camera.hpp.
Referenced by cameraApplyJS(), and cameraToJS().
| bool esengine::ecs::Camera::pixelPerfect {false} |
Snap the camera to the world-space pixel grid (Orthographic) so static pixel art renders crisp, without sub-pixel shimmer when the camera moves.
Definition at line 117 of file Camera.hpp.
Referenced by cameraApplyJS(), and cameraToJS().
| i32 esengine::ecs::Camera::priority {0} |
Priority for determining active camera (higher = preferred).
Definition at line 102 of file Camera.hpp.
Referenced by cameraApplyJS(), and cameraToJS().
| ProjectionType esengine::ecs::Camera::projectionType {ProjectionType::Perspective} |
Projection type.
Definition at line 73 of file Camera.hpp.
Referenced by cameraApplyJS(), and cameraToJS().
| u32 esengine::ecs::Camera::renderTarget {0} |
Offscreen target this camera draws into; 0 = the screen. A RenderTexture handle, so it is created at run time and set from a script — a minimap, a mirror, a portrait rendered once. The camera's viewport covers the whole target, whose own size decides the resolution.
Definition at line 129 of file Camera.hpp.
Referenced by cameraApplyJS(), and cameraToJS().
| glm::vec4 esengine::ecs::Camera::viewport {0.0f, 0.0f, 1.0f, 1.0f} |
Viewport rectangle (x, y, width, height) in normalized coords.
Definition at line 106 of file Camera.hpp.
Referenced by cameraApplyJS(), and cameraToJS().