Class camera

Nested Relationships

Class Documentation

class legion::rendering::camera

Camera component.

Public Functions

inline void set_projection(float fov, float nearz, float farz)

Set the projection variables of the camera.

  • fov: Horizontal field of view in degrees.

  • nearz: Near plane distance from the camera.

  • farz: Far plane distance from the camera.

inline math::mat4 get_projection(float ratio)

Get the projection matrix for a certain aspect ratio.

  • ratio: Aspect ratio (width / height)

template<class Archive>
inline void serialize(Archive &oa)

Public Members

ecs::component_handle<app::window> targetWindow = ecs::component_handle<app::window>(world_entity_id)
framebuffer renderTarget = framebuffer()
math::color clearColor = math::colors::cornflower
float fov
float nearz
float farz


friend class OldRenderer
friend class Renderer
struct camera_input

Public Functions

inline camera_input(math::mat4 view, math::mat4 proj, math::vec3 pos, math::vec3 vdir, float nearz, float farz, math::ivec2 viewportSize)
inline void bind(material_handle &materialHandle) const

Public Members

math::vec4 data[10]
math::mat4 view
math::mat4 proj
math::vec3 pos
float nearz
math::vec4 posnearz
math::vec3 vdir
float farz
math::vec4 vdirfarz
math::ivec2 viewportSize
union legion::rendering::camera::camera_input::[anonymous] [anonymous]