OGLplus  (0.59.0) a C++ wrapper for rendering APIs

eagine::application::orbiting_camera Class Reference

Extension of orbiting camera wrapper. More...

#include <eagine/application/camera.hpp>

Public Member Functions

auto matrix (video_context &vc) const noexcept
 Construction from a reference to a video context.
 
auto has_changed () noexcept
 Inddicates if the camera has changed and resets the flag.
 
auto update_orbit (float inc) noexcept -> orbiting_camera &
 Does a generic orbit update with given increment.
 
auto update_turns (float inc) noexcept -> orbiting_camera &
 Does a generic azimuth update with given increment.
 
auto update_pitch (float inc) noexcept -> orbiting_camera &
 Does a generic elevation update with given increment.
 
auto idle_update (const context_state_view &, const valid_if_positive< float > &divisor=2.F) noexcept -> orbiting_camera &
 Does a generic combined update when the user does not provide input. More...
 
auto idle_update (const execution_context &, const valid_if_positive< float > &divisor=2.F) noexcept -> orbiting_camera &
 Does a generic combined update when the user does not provide input. More...
 
auto pressure_input () noexcept -> input_slot
 Returns the input slot for handling cursor pressure input signals. This can be bound for example to mouse button press input signal. More...
 
auto dampening_input () noexcept -> input_slot
 Returns the input slot for handling motion dampening input signals. This can be bound for example to control or shift key press input signal. More...
 
auto altitude_change_input () noexcept -> input_slot
 Returns the input slot for handling orbit change input signals. This can be bound for example to mouse wheel scroll input signal. More...
 
auto longitude_change_input () noexcept -> input_slot
 Returns the input slot for handling azimuth change input signals. This can be bound for example to left/right arrow key press input signals. More...
 
auto latitude_change_input () noexcept -> input_slot
 Returns the input slot for handling elevation change input signals. This can be bound for example to up/down arrow key press input signals. More...
 
auto connect_inputs (execution_context &ec) -> orbiting_camera &
 Connects the camera input slots to the execution context. More...
 
auto basic_input_mapping (execution_context &ec, identifier mapping_id) -> orbiting_camera &
 Specifies a named key binding for the camera input slots. More...
 
auto basic_input_mapping (execution_context &ec) -> auto &
 Specifies the default key binding for the camera input slots. More...
 
auto matrix (float aspect) const noexcept
 Returns the camera matrix (perspective * projection).
 
- Public Member Functions inherited from eagine::oglp::orbiting_camera
auto set_target (vec3 target) noexcept -> auto &
 Sets the target position.
 
auto set_fov (radians_t< float > angle) noexcept -> auto &
 Sets the y-axis FOV angle.
 
auto set_near (valid_if_positive< float > dist) noexcept -> auto &
 Sets the distance of the near plane.
 
auto set_far (valid_if_positive< float > dist) noexcept -> auto &
 Sets the distance of the far plane.
 
auto set_orbit_min (valid_if_positive< float > orbit) noexcept -> auto &
 Set minimal orbit value.
 
auto set_orbit_max (valid_if_positive< float > orbit) noexcept -> auto &
 Set maximal orbit value.
 
auto fov () const noexcept -> radians_t< float >
 Returns the y-axis FOV angle.
 
auto orbit () const noexcept -> float
 Returns the orbit altitude value. More...
 
auto azimuth () const noexcept -> radians_t< float >
 Returns the azimuth angle (longitude). More...
 
auto elevation () const noexcept -> radians_t< float >
 Returns the elevation angle (latitude). More...
 
auto target () const noexcept -> vec3
 Returns the target position. More...
 
auto target_to_camera_direction () const noexcept -> vec3
 Returns the target-to-camera direction vector. More...
 
auto camera_to_target_direction () const noexcept -> vec3
 Returns the camera-to-target direction vector. More...
 
auto position () const noexcept -> vec3
 Returns the position of the camera. More...
 
auto perspective_matrix (float aspect) const noexcept
 Returns the perspective matrix for the given aspect ratio.
 
auto transform_matrix () const noexcept
 Returns the camera transformation matrix.
 
auto matrix (float aspect) const noexcept
 Returns the camera matrix (perspective * projection).
 
auto target_plane_point (float ndcx, float ndcy, float aspect) const noexcept -> optionally_valid< vec3 >
 Returns the 3D position of a point (in NDC) on the target plane.
 
auto pointer_ray (float ndcx, float ndcy, float aspect) const noexcept -> optionally_valid< line >
 Returns a ray from the camera through a point on the target plane.
 

Detailed Description

Extension of orbiting camera wrapper.

Member Function Documentation

◆ altitude_change_input()

auto eagine::application::orbiting_camera::altitude_change_input ( ) -> input_slot
inlinenoexcept

Returns the input slot for handling orbit change input signals. This can be bound for example to mouse wheel scroll input signal.

See also
connect_inputs
basic_input_mapping

◆ basic_input_mapping() [1/2]

auto eagine::application::orbiting_camera::basic_input_mapping ( execution_context ec) -> auto&
inline

Specifies the default key binding for the camera input slots.

See also
connect_inputs

◆ basic_input_mapping() [2/2]

auto eagine::application::orbiting_camera::basic_input_mapping ( execution_context ec,
identifier  mapping_id 
) -> orbiting_camera &

Specifies a named key binding for the camera input slots.

See also
connect_inputs

Referenced by basic_input_mapping().

◆ connect_inputs()

auto eagine::application::orbiting_camera::connect_inputs ( execution_context ec) -> orbiting_camera &

Connects the camera input slots to the execution context.

See also
basic_input_mapping

◆ dampening_input()

auto eagine::application::orbiting_camera::dampening_input ( ) -> input_slot
inlinenoexcept

Returns the input slot for handling motion dampening input signals. This can be bound for example to control or shift key press input signal.

See also
connect_inputs
basic_input_mapping

◆ idle_update() [1/2]

auto eagine::application::orbiting_camera::idle_update ( const context_state_view ,
const valid_if_positive< float > &  divisor = 2.F 
) -> orbiting_camera &
noexcept

Does a generic combined update when the user does not provide input.

See also
update_orbit
update_turns
update_pitch

◆ idle_update() [2/2]

auto eagine::application::orbiting_camera::idle_update ( const execution_context ,
const valid_if_positive< float > &  divisor = 2.F 
) -> orbiting_camera &
noexcept

Does a generic combined update when the user does not provide input.

See also
update_orbit
update_turns
update_pitch

◆ latitude_change_input()

auto eagine::application::orbiting_camera::latitude_change_input ( ) -> input_slot
inlinenoexcept

Returns the input slot for handling elevation change input signals. This can be bound for example to up/down arrow key press input signals.

See also
connect_inputs
basic_input_mapping

◆ longitude_change_input()

auto eagine::application::orbiting_camera::longitude_change_input ( ) -> input_slot
inlinenoexcept

Returns the input slot for handling azimuth change input signals. This can be bound for example to left/right arrow key press input signals.

See also
connect_inputs
basic_input_mapping

◆ pressure_input()

auto eagine::application::orbiting_camera::pressure_input ( ) -> input_slot
inlinenoexcept

Returns the input slot for handling cursor pressure input signals. This can be bound for example to mouse button press input signal.

See also
connect_inputs
basic_input_mapping

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

Copyright © 2015-2021 Matúš Chochlík.
<chochlik -at -gmail.com>
Documentation generated on Tue Apr 13 2021 by Doxygen (version 1.8.17).