Unravel Engine C++ Reference
Loading...
Searching...
No Matches
unravel::camera Class Reference

Class representing a camera. Contains functionality for manipulating and updating a camera. It should not be used as a standalone class - see camera_component and the entity system. More...

#include <camera.h>

Inheritance diagram for unravel::camera:
crtp_meta_type< camera >

Public Member Functions

void set_projection_mode (projection_mode mode)
 Sets the current projection mode for this camera (i.e. orthographic or perspective).
 
void set_fov (float degrees)
 Sets the field of view angle of this camera (perspective only).
 
void set_near_clip (float distance)
 Sets the near plane distance.
 
void set_far_clip (float distance)
 Sets the far plane distance.
 
void set_orthographic_size (float size)
 Sets the half of the vertical size of the viewing volume in world units.
 
auto get_projection_mode () const -> projection_mode
 Retrieves the current projection mode for this camera.
 
auto get_fov () const -> float
 Retrieves the current field of view angle in degrees.
 
auto get_near_clip () const -> float
 Retrieves the distance from the camera to the near clip plane.
 
auto get_far_clip () const -> float
 Retrieves the distance from the camera to the far clip plane.
 
auto get_ortho_size () const -> float
 Retrieves the orthographic size.
 
auto get_zoom_factor () const -> float
 Retrieves the zoom factor.
 
auto get_ppu () const -> float
 Retrieves the pixels per unit (PPU).
 
void set_viewport_size (const usize32_t &viewportSize)
 Sets the size of the viewport.
 
void set_viewport_pos (const upoint32_t &viewportPos)
 Sets the position of the viewport.
 
auto get_viewport_size () const -> const usize32_t &
 Retrieves the size of the viewport.
 
auto get_viewport_pos () const -> const upoint32_t &
 Retrieves the position of the viewport.
 
void set_aspect_ratio (float aspect, bool locked=false)
 Sets the aspect ratio to be used for generating the horizontal FOV angle (perspective only).
 
auto get_aspect_ratio () const -> float
 Retrieves the aspect ratio used to generate the horizontal FOV angle.
 
auto is_aspect_locked () const -> bool
 Determines if the aspect ratio is currently being updated by the render driver.
 
auto is_frustum_locked () const -> bool
 Checks if the frustum is currently locked.
 
void lock_frustum (bool locked)
 Locks or unlocks the frustum.
 
auto get_frustum () const -> const math::frustum &
 Retrieves the current camera object frustum.
 
auto get_clipping_volume () const -> const math::frustum &
 Retrieves the frustum representing the space between the camera position and its near plane.
 
auto get_projection () const -> const math::transform &
 Retrieves the current projection matrix.
 
auto get_prev_projection () const -> const math::transform &
 
auto get_view () const -> const math::transform &
 Retrieves the current view matrix.
 
auto get_prev_view () const -> const math::transform &
 
auto get_view_inverse () const -> const math::transform &
 
auto get_view_relative () const -> const math::transform &
 
auto get_prev_view_relative () const -> const math::transform &
 
auto get_view_inverse_relative () const -> const math::transform &
 
auto get_prev_view_projection () const -> math::transform
 Retrieves the previous view matrix.
 
auto get_prev_view_projection_relative () const -> math::transform
 
auto get_view_projection () const -> math::transform
 Retrieves the current view-projection matrix.
 
auto get_view_projection_relative () const -> math::transform
 
void record_current_matrices ()
 Makes a copy of the current view and projection matrices before they are changed.
 
void set_aa_data (const usize32_t &viewportSize, std::uint32_t currentSubpixelIndex, std::uint32_t temporalAASamples)
 Sets the current jitter value for temporal anti-aliasing.
 
auto get_aa_data () const -> const math::vec4 &
 Retrieves the anti-aliasing data.
 
auto classify_aabb (const math::bbox &bounds) const -> math::volume_query
 Determines if the specified AABB falls within the frustum.
 
auto test_aabb (const math::bbox &bounds) const -> bool
 Tests if the specified AABB is within the frustum.
 
auto classify_obb (const math::bbox &bounds, const math::transform &t) const -> math::volume_query
 Determines if the specified OBB is within the frustum.
 
auto test_obb (const math::bbox &bounds, const math::transform &t) const -> bool
 Tests if the specified OBB is within the frustum.
 
auto test_billboard (float size, const math::transform &t) const -> bool
 
auto viewport_to_ray (const math::vec2 &point, math::vec3 &vec_ray_start, math::vec3 &vec_ray_dir) const -> bool
 Converts the specified screen position into a ray origin and direction vector.
 
auto viewport_to_world (const math::vec2 &point, const math::plane &plane, math::vec3 &position_out, bool clip) const -> bool
 Converts a screen position into a world space position on the specified plane.
 
auto viewport_to_major_axis (const math::vec2 &point, const math::vec3 &axis_origin, math::vec3 &position_out, math::vec3 &major_axis_out) const -> bool
 Converts a screen position into a world space intersection point on a major axis plane.
 
auto viewport_to_major_axis (const math::vec2 &point, const math::vec3 &axis_origin, const math::vec3 &align_normal, math::vec3 &position_out, math::vec3 &major_axis_out) const -> bool
 Converts a screen position into a world space intersection point on a major axis plane.
 
auto viewport_to_camera (const math::vec3 &point, math::vec3 &position_out) const -> bool
 Converts a screen position into a camera space position at the near plane.
 
auto world_to_viewport (const math::vec3 &pos) const -> math::vec3
 Transforms a point from world space into screen space.
 
auto estimate_zoom_factor (const math::plane &plane) const -> float
 Estimates the zoom factor based on the specified plane.
 
auto estimate_zoom_factor (const math::vec3 &position) const -> float
 Estimates the zoom factor based on the specified position.
 
auto estimate_zoom_factor (const math::plane &plane, float maximum_value) const -> float
 Estimates the zoom factor based on the specified plane, constrained by a maximum value.
 
auto estimate_zoom_factor (const math::vec3 &position, float maximum_value) const -> float
 Estimates the zoom factor based on the specified position, constrained by a maximum value.
 
auto estimate_pick_tolerance (float pixel_tolerance, const math::vec3 &reference_position, const math::transform &object_transform) const -> math::vec3
 Estimates the pick tolerance based on the pixel tolerance and reference position.
 
void look_at (const math::vec3 &eye, const math::vec3 &at)
 Sets the camera to look at a specified target.
 
void look_at (const math::vec3 &eye, const math::vec3 &at, const math::vec3 &vUp)
 Sets the camera to look at a specified target with an up vector.
 
auto get_position () const -> const math::vec3 &
 Retrieves the current position of the camera.
 
auto x_unit_axis () const -> math::vec3
 Retrieves the x-axis unit vector of the camera's local coordinate system.
 
auto y_unit_axis () const -> math::vec3
 Retrieves the y-axis unit vector of the camera's local coordinate system.
 
auto z_unit_axis () const -> math::vec3
 Retrieves the z-axis unit vector of the camera's local coordinate system.
 
auto get_local_bounding_box () -> math::bbox
 Retrieves the bounding box of this object.
 
void touch ()
 Marks the camera as modified.
 
- Public Member Functions inherited from crtp_meta_type< camera >
virtual auto get_meta_type () const -> entt::meta_type
 
auto is () const -> bool
 
auto is (const entt::meta_type &type) const -> bool
 
virtual auto as_derived () -> entt::meta_any
 

Static Public Member Functions

static auto get_face_camera (std::uint32_t face, const math::transform &transform) -> camera
 Retrieves a camera for one of six cube faces.
 
- Static Public Member Functions inherited from crtp_meta_type< camera >
static auto get_static_meta_type () -> entt::meta_type
 

Protected Attributes

math::vec4 aa_data_ = {0.0f, 0.0f, 0.0f, 0.0f}
 Anti-aliasing data.
 
math::transform view_
 Cached view matrix.
 
math::transform view_inverse_
 
math::transform view_relative_
 
math::transform view_inverse_relative_
 
math::transform projection_
 Cached projection matrix.
 
math::transform last_view_
 Cached "previous" view matrix.
 
math::transform last_view_relative_
 
math::transform last_projection_
 Cached "previous" projection matrix.
 
math::frustum frustum_
 Details regarding the camera frustum.
 
math::frustum clipping_volume_
 The near clipping volume (area of space between the camera position and the near plane).
 
projection_mode projection_mode_ = projection_mode::perspective
 The type of projection currently selected for this camera.
 
float fov_ = 60.0f
 Vertical degrees angle (perspective only).
 
float near_clip_ = 0.1f
 Near clip plane Distance.
 
float far_clip_ = 1000.0f
 Far clip plane Distance.
 
float ortho_size_ = 5
 camera's half-size when in orthographic mode.
 
float aspect_ratio_ = 1.0f
 The aspect ratio used to generate the correct horizontal degrees (perspective only)
 
upoint32_t viewport_pos_ = {0, 0}
 Viewport position.
 
usize32_t viewport_size_ = {0, 0}
 Viewport size.
 
bool view_dirty_ = true
 View matrix dirty ?
 
bool projection_dirty_ = true
 Projection matrix dirty ?
 
bool aspect_dirty_ = true
 Has the aspect ratio changed?
 
bool frustum_dirty_ = true
 Are the frustum planes dirty ?
 
bool aspect_locked_ = false
 Should the aspect ratio be automatically updated by the render driver?
 
bool frustum_locked_ = false
 Is the frustum locked?
 

Detailed Description

Class representing a camera. Contains functionality for manipulating and updating a camera. It should not be used as a standalone class - see camera_component and the entity system.

Definition at line 34 of file camera.h.

Member Function Documentation

◆ classify_aabb()

auto unravel::camera::classify_aabb ( const math::bbox & bounds) const -> math::volume_query

Determines if the specified AABB falls within the frustum.

Parameters
boundsThe AABB to test.
Returns
The result of the volume query.

Definition at line 417 of file camera.cpp.

◆ classify_obb()

auto unravel::camera::classify_obb ( const math::bbox & bounds,
const math::transform & t ) const -> math::volume_query

Determines if the specified OBB is within the frustum.

Parameters
boundsThe OBB to test.
tThe transformation to apply to the OBB.
Returns
The result of the volume query.

Definition at line 435 of file camera.cpp.

◆ estimate_pick_tolerance()

auto unravel::camera::estimate_pick_tolerance ( float pixel_tolerance,
const math::vec3 & reference_position,
const math::transform & object_transform ) const -> math::vec3

Estimates the pick tolerance based on the pixel tolerance and reference position.

Parameters
pixel_toleranceThe pixel tolerance.
reference_positionThe reference position.
object_transformThe transformation to apply to the object.
Returns
The estimated pick tolerance.

Definition at line 710 of file camera.cpp.

◆ estimate_zoom_factor() [1/4]

auto unravel::camera::estimate_zoom_factor ( const math::plane & plane) const -> float

Estimates the zoom factor based on the specified plane.

Parameters
planeThe reference plane.
Returns
The estimated zoom factor.

Definition at line 640 of file camera.cpp.

◆ estimate_zoom_factor() [2/4]

auto unravel::camera::estimate_zoom_factor ( const math::plane & plane,
float maximum_value ) const -> float

Estimates the zoom factor based on the specified plane, constrained by a maximum value.

Parameters
planeThe reference plane.
maximum_valueThe maximum zoom factor value.
Returns
The estimated zoom factor.

Definition at line 673 of file camera.cpp.

◆ estimate_zoom_factor() [3/4]

auto unravel::camera::estimate_zoom_factor ( const math::vec3 & position) const -> float

Estimates the zoom factor based on the specified position.

Given the current viewport type and projection mode, estimate the "zoom" factor that can be used for scaling various operations relative to the "scale" of an object as it appears in the viewport at the specified position.

Parameters
positionThe reference position.
Returns
The estimated zoom factor.

Definition at line 668 of file camera.cpp.

◆ estimate_zoom_factor() [4/4]

auto unravel::camera::estimate_zoom_factor ( const math::vec3 & position,
float maximum_value ) const -> float

Estimates the zoom factor based on the specified position, constrained by a maximum value.

Parameters
positionThe reference position.
maximum_valueThe maximum zoom factor value.
Returns
The estimated zoom factor.

Definition at line 693 of file camera.cpp.

◆ get_aa_data()

auto unravel::camera::get_aa_data ( ) const -> const math::vec4&

Retrieves the anti-aliasing data.

Returns
The anti-aliasing data.

Definition at line 808 of file camera.cpp.

◆ get_aspect_ratio()

auto unravel::camera::get_aspect_ratio ( ) const -> float

Retrieves the aspect ratio used to generate the horizontal FOV angle.

Returns
The aspect ratio.

Definition at line 183 of file camera.cpp.

◆ get_clipping_volume()

auto unravel::camera::get_clipping_volume ( ) const -> const math::frustum&

Retrieves the frustum representing the space between the camera position and its near plane.

Returns
The clipping volume frustum.

Definition at line 405 of file camera.cpp.

◆ get_face_camera()

auto unravel::camera::get_face_camera ( std::uint32_t face,
const math::transform & transform ) -> camera
static

Retrieves a camera for one of six cube faces.

Parameters
faceThe index of the cube face.
transformThe transformation to apply.
Returns
The corresponding face camera.

Definition at line 822 of file camera.cpp.

◆ get_far_clip()

auto unravel::camera::get_far_clip ( ) const -> float

Retrieves the distance from the camera to the far clip plane.

Returns
The far clip distance.

Definition at line 67 of file camera.cpp.

◆ get_fov()

auto unravel::camera::get_fov ( ) const -> float

Retrieves the current field of view angle in degrees.

Returns
The field of view angle.

Definition at line 57 of file camera.cpp.

◆ get_frustum()

auto unravel::camera::get_frustum ( ) const -> const math::frustum&

Retrieves the current camera object frustum.

Returns
The current frustum.

Definition at line 365 of file camera.cpp.

◆ get_local_bounding_box()

auto unravel::camera::get_local_bounding_box ( ) -> math::bbox

Retrieves the bounding box of this object.

Returns
The local bounding box.

Definition at line 145 of file camera.cpp.

◆ get_near_clip()

auto unravel::camera::get_near_clip ( ) const -> float

Retrieves the distance from the camera to the near clip plane.

Returns
The near clip distance.

Definition at line 62 of file camera.cpp.

◆ get_ortho_size()

auto unravel::camera::get_ortho_size ( ) const -> float

Retrieves the orthographic size.

Returns
The orthographic size.

Definition at line 72 of file camera.cpp.

◆ get_position()

auto unravel::camera::get_position ( ) const -> const math::vec3&

Retrieves the current position of the camera.

Returns
The current camera position.

Definition at line 346 of file camera.cpp.

◆ get_ppu()

auto unravel::camera::get_ppu ( ) const -> float

Retrieves the pixels per unit (PPU).

Returns
The PPU value.

Definition at line 19 of file camera.cpp.

◆ get_prev_projection()

auto unravel::camera::get_prev_projection ( ) const -> const math::transform&

Definition at line 271 of file camera.cpp.

◆ get_prev_view()

auto unravel::camera::get_prev_view ( ) const -> const math::transform&

Definition at line 281 of file camera.cpp.

◆ get_prev_view_projection()

auto unravel::camera::get_prev_view_projection ( ) const -> math::transform

Retrieves the previous view matrix.

Returns
The previous view matrix.

Definition at line 311 of file camera.cpp.

◆ get_prev_view_projection_relative()

auto unravel::camera::get_prev_view_projection_relative ( ) const -> math::transform

Definition at line 321 of file camera.cpp.

◆ get_prev_view_relative()

auto unravel::camera::get_prev_view_relative ( ) const -> const math::transform&

Definition at line 291 of file camera.cpp.

◆ get_projection()

auto unravel::camera::get_projection ( ) const -> const math::transform&

Retrieves the current projection matrix.

Returns
The current projection matrix.

Definition at line 203 of file camera.cpp.

◆ get_projection_mode()

auto unravel::camera::get_projection_mode ( ) const -> projection_mode

Retrieves the current projection mode for this camera.

Returns
The current projection mode.

Definition at line 52 of file camera.cpp.

◆ get_view()

auto unravel::camera::get_view ( ) const -> const math::transform&

Retrieves the current view matrix.

Returns
The current view matrix.

Definition at line 276 of file camera.cpp.

◆ get_view_inverse()

auto unravel::camera::get_view_inverse ( ) const -> const math::transform&

Definition at line 296 of file camera.cpp.

◆ get_view_inverse_relative()

auto unravel::camera::get_view_inverse_relative ( ) const -> const math::transform&

Definition at line 301 of file camera.cpp.

◆ get_view_projection()

auto unravel::camera::get_view_projection ( ) const -> math::transform

Retrieves the current view-projection matrix.

Returns
The current view-projection matrix.

Definition at line 306 of file camera.cpp.

◆ get_view_projection_relative()

auto unravel::camera::get_view_projection_relative ( ) const -> math::transform

Definition at line 316 of file camera.cpp.

◆ get_view_relative()

auto unravel::camera::get_view_relative ( ) const -> const math::transform&

Definition at line 286 of file camera.cpp.

◆ get_viewport_pos()

auto unravel::camera::get_viewport_pos ( ) const -> const upoint32_t&

Retrieves the position of the viewport.

Returns
The position of the viewport.

Definition at line 40 of file camera.cpp.

◆ get_viewport_size()

auto unravel::camera::get_viewport_size ( ) const -> const usize32_t&

Retrieves the size of the viewport.

Returns
The size of the viewport.

Definition at line 35 of file camera.cpp.

◆ get_zoom_factor()

auto unravel::camera::get_zoom_factor ( ) const -> float

Retrieves the zoom factor.

Returns
The zoom factor.

Definition at line 9 of file camera.cpp.

◆ is_aspect_locked()

auto unravel::camera::is_aspect_locked ( ) const -> bool

Determines if the aspect ratio is currently being updated by the render driver.

Returns
true if the aspect ratio is locked, false otherwise.

Definition at line 188 of file camera.cpp.

◆ is_frustum_locked()

auto unravel::camera::is_frustum_locked ( ) const -> bool

Checks if the frustum is currently locked.

Returns
true if the frustum is locked, false otherwise.

Definition at line 193 of file camera.cpp.

◆ lock_frustum()

void unravel::camera::lock_frustum ( bool locked)

Locks or unlocks the frustum.

Parameters
lockedWhether the frustum should be locked.

Definition at line 198 of file camera.cpp.

◆ look_at() [1/2]

void unravel::camera::look_at ( const math::vec3 & eye,
const math::vec3 & at )

Sets the camera to look at a specified target.

Parameters
eyeThe eye position.
atThe target position.

Definition at line 326 of file camera.cpp.

◆ look_at() [2/2]

void unravel::camera::look_at ( const math::vec3 & eye,
const math::vec3 & at,
const math::vec3 & vUp )

Sets the camera to look at a specified target with an up vector.

Parameters
eyeThe eye position.
atThe target position.
vUpThe up vector.

Definition at line 331 of file camera.cpp.

◆ record_current_matrices()

void unravel::camera::record_current_matrices ( )

Makes a copy of the current view and projection matrices before they are changed.

Definition at line 724 of file camera.cpp.

◆ set_aa_data()

void unravel::camera::set_aa_data ( const usize32_t & viewportSize,
std::uint32_t currentSubpixelIndex,
std::uint32_t temporalAASamples )

Sets the current jitter value for temporal anti-aliasing.

Parameters
viewportSizeThe size of the viewport.
currentSubpixelIndexThe current subpixel index.
temporalAASamplesThe number of temporal AA samples.

Definition at line 732 of file camera.cpp.

◆ set_aspect_ratio()

void unravel::camera::set_aspect_ratio ( float aspect,
bool locked = false )

Sets the aspect ratio to be used for generating the horizontal FOV angle (perspective only).

Parameters
aspectThe aspect ratio to set.
lockedWhether the aspect ratio should be locked.

Definition at line 165 of file camera.cpp.

◆ set_far_clip()

void unravel::camera::set_far_clip ( float distance)

Sets the far plane distance.

Parameters
distanceThe distance to the far clipping plane.

Definition at line 125 of file camera.cpp.

◆ set_fov()

void unravel::camera::set_fov ( float degrees)

Sets the field of view angle of this camera (perspective only).

Parameters
degreesThe field of view in degrees.

Definition at line 77 of file camera.cpp.

◆ set_near_clip()

void unravel::camera::set_near_clip ( float distance)

Sets the near plane distance.

Parameters
distanceThe distance to the near clipping plane.

Definition at line 105 of file camera.cpp.

◆ set_orthographic_size()

void unravel::camera::set_orthographic_size ( float size)

Sets the half of the vertical size of the viewing volume in world units.

Parameters
sizeThe size to set.

Definition at line 45 of file camera.cpp.

◆ set_projection_mode()

void unravel::camera::set_projection_mode ( projection_mode mode)

Sets the current projection mode for this camera (i.e. orthographic or perspective).

Parameters
modeThe projection mode to set.

Definition at line 91 of file camera.cpp.

◆ set_viewport_pos()

void unravel::camera::set_viewport_pos ( const upoint32_t & viewportPos)

Sets the position of the viewport.

Parameters
viewportPosThe position of the viewport.

Definition at line 30 of file camera.cpp.

◆ set_viewport_size()

void unravel::camera::set_viewport_size ( const usize32_t & viewportSize)

Sets the size of the viewport.

Parameters
viewportSizeThe size of the viewport.

Definition at line 24 of file camera.cpp.

◆ test_aabb()

auto unravel::camera::test_aabb ( const math::bbox & bounds) const -> bool

Tests if the specified AABB is within the frustum.

Parameters
boundsThe AABB to test.
Returns
true if the AABB is within the frustum, false otherwise.

Definition at line 426 of file camera.cpp.

◆ test_billboard()

auto unravel::camera::test_billboard ( float size,
const math::transform & t ) const -> bool

Definition at line 453 of file camera.cpp.

◆ test_obb()

auto unravel::camera::test_obb ( const math::bbox & bounds,
const math::transform & t ) const -> bool

Tests if the specified OBB is within the frustum.

Parameters
boundsThe OBB to test.
tThe transformation to apply to the OBB.
Returns
true if the OBB is within the frustum, false otherwise.

Definition at line 444 of file camera.cpp.

◆ touch()

void unravel::camera::touch ( )

Marks the camera as modified.

Definition at line 813 of file camera.cpp.

◆ viewport_to_camera()

auto unravel::camera::viewport_to_camera ( const math::vec3 & point,
math::vec3 & position_out ) const -> bool

Converts a screen position into a camera space position at the near plane.

Parameters
pointThe screen position.
position_outThe output camera space position.
Returns
true if the conversion is successful, false otherwise.

Definition at line 626 of file camera.cpp.

◆ viewport_to_major_axis() [1/2]

auto unravel::camera::viewport_to_major_axis ( const math::vec2 & point,
const math::vec3 & axis_origin,
const math::vec3 & align_normal,
math::vec3 & position_out,
math::vec3 & major_axis_out ) const -> bool

Converts a screen position into a world space intersection point on a major axis plane.

Parameters
pointThe screen position.
axis_originThe origin of the axis.
align_normalThe alignment normal.
position_outThe output world space position.
major_axis_outThe output major axis.
Returns
true if the conversion is successful, false otherwise.

Definition at line 583 of file camera.cpp.

◆ viewport_to_major_axis() [2/2]

auto unravel::camera::viewport_to_major_axis ( const math::vec2 & point,
const math::vec3 & axis_origin,
math::vec3 & position_out,
math::vec3 & major_axis_out ) const -> bool

Converts a screen position into a world space intersection point on a major axis plane.

Parameters
pointThe screen position.
axis_originThe origin of the axis.
position_outThe output world space position.
major_axis_outThe output major axis.
Returns
true if the conversion is successful, false otherwise.

Definition at line 575 of file camera.cpp.

◆ viewport_to_ray()

auto unravel::camera::viewport_to_ray ( const math::vec2 & point,
math::vec3 & vec_ray_start,
math::vec3 & vec_ray_dir ) const -> bool

Converts the specified screen position into a ray origin and direction vector.

Parameters
pointThe screen position.
rayOriginOutThe output ray origin.
rayDirectionOutThe output ray direction.
Returns
true if the conversion is successful, false otherwise.

Definition at line 490 of file camera.cpp.

◆ viewport_to_world()

auto unravel::camera::viewport_to_world ( const math::vec2 & point,
const math::plane & plane,
math::vec3 & position_out,
bool clip ) const -> bool

Converts a screen position into a world space position on the specified plane.

Parameters
pointThe screen position.
planeThe plane to intersect.
position_outThe output world space position.
clipWhether to clip the result.
Returns
true if the conversion is successful, false otherwise.

Definition at line 523 of file camera.cpp.

◆ world_to_viewport()

auto unravel::camera::world_to_viewport ( const math::vec3 & pos) const -> math::vec3

Transforms a point from world space into screen space.

Parameters
posThe world space position.
Returns
The screen space position.

Definition at line 466 of file camera.cpp.

◆ x_unit_axis()

auto unravel::camera::x_unit_axis ( ) const -> math::vec3

Retrieves the x-axis unit vector of the camera's local coordinate system.

Returns
The x-axis unit vector.

Definition at line 351 of file camera.cpp.

◆ y_unit_axis()

auto unravel::camera::y_unit_axis ( ) const -> math::vec3

Retrieves the y-axis unit vector of the camera's local coordinate system.

Returns
The y-axis unit vector.

Definition at line 355 of file camera.cpp.

◆ z_unit_axis()

auto unravel::camera::z_unit_axis ( ) const -> math::vec3

Retrieves the z-axis unit vector of the camera's local coordinate system.

Returns
The z-axis unit vector.

Definition at line 360 of file camera.cpp.

Member Data Documentation

◆ aa_data_

math::vec4 unravel::camera::aa_data_ = {0.0f, 0.0f, 0.0f, 0.0f}
protected

Anti-aliasing data.

Definition at line 478 of file camera.h.

◆ aspect_dirty_

bool unravel::camera::aspect_dirty_ = true
mutableprotected

Has the aspect ratio changed?

Definition at line 519 of file camera.h.

◆ aspect_locked_

bool unravel::camera::aspect_locked_ = false
protected

Should the aspect ratio be automatically updated by the render driver?

Definition at line 523 of file camera.h.

◆ aspect_ratio_

float unravel::camera::aspect_ratio_ = 1.0f
protected

The aspect ratio used to generate the correct horizontal degrees (perspective only)

Definition at line 509 of file camera.h.

◆ clipping_volume_

math::frustum unravel::camera::clipping_volume_
mutableprotected

The near clipping volume (area of space between the camera position and the near plane).

Definition at line 497 of file camera.h.

◆ far_clip_

float unravel::camera::far_clip_ = 1000.0f
protected

Far clip plane Distance.

Definition at line 505 of file camera.h.

◆ fov_

float unravel::camera::fov_ = 60.0f
protected

Vertical degrees angle (perspective only).

Definition at line 501 of file camera.h.

◆ frustum_

math::frustum unravel::camera::frustum_
mutableprotected

Details regarding the camera frustum.

Definition at line 495 of file camera.h.

◆ frustum_dirty_

bool unravel::camera::frustum_dirty_ = true
mutableprotected

Are the frustum planes dirty ?

Definition at line 521 of file camera.h.

◆ frustum_locked_

bool unravel::camera::frustum_locked_ = false
protected

Is the frustum locked?

Definition at line 525 of file camera.h.

◆ last_projection_

math::transform unravel::camera::last_projection_
protected

Cached "previous" projection matrix.

Definition at line 493 of file camera.h.

◆ last_view_

math::transform unravel::camera::last_view_
protected

Cached "previous" view matrix.

Definition at line 489 of file camera.h.

◆ last_view_relative_

math::transform unravel::camera::last_view_relative_
protected

Definition at line 490 of file camera.h.

◆ near_clip_

float unravel::camera::near_clip_ = 0.1f
protected

Near clip plane Distance.

Definition at line 503 of file camera.h.

◆ ortho_size_

float unravel::camera::ortho_size_ = 5
protected

camera's half-size when in orthographic mode.

Definition at line 507 of file camera.h.

◆ projection_

math::transform unravel::camera::projection_
mutableprotected

Cached projection matrix.

Definition at line 487 of file camera.h.

◆ projection_dirty_

bool unravel::camera::projection_dirty_ = true
mutableprotected

Projection matrix dirty ?

Definition at line 517 of file camera.h.

◆ projection_mode_

projection_mode unravel::camera::projection_mode_ = projection_mode::perspective
protected

The type of projection currently selected for this camera.

Definition at line 499 of file camera.h.

◆ view_

math::transform unravel::camera::view_
protected

Cached view matrix.

Definition at line 480 of file camera.h.

◆ view_dirty_

bool unravel::camera::view_dirty_ = true
protected

View matrix dirty ?

Definition at line 515 of file camera.h.

◆ view_inverse_

math::transform unravel::camera::view_inverse_
protected

Definition at line 481 of file camera.h.

◆ view_inverse_relative_

math::transform unravel::camera::view_inverse_relative_
protected

Definition at line 484 of file camera.h.

◆ view_relative_

math::transform unravel::camera::view_relative_
protected

Definition at line 483 of file camera.h.

◆ viewport_pos_

upoint32_t unravel::camera::viewport_pos_ = {0, 0}
protected

Viewport position.

Definition at line 511 of file camera.h.

◆ viewport_size_

usize32_t unravel::camera::viewport_size_ = {0, 0}
protected

Viewport size.

Definition at line 513 of file camera.h.


The documentation for this class was generated from the following files: