Go to the documentation of this file.
9 #ifndef EAGINE_APPLICATION_CAMERA_HPP
10 #define EAGINE_APPLICATION_CAMERA_HPP
33 return std::exchange(_changed,
false);
63 constexpr
auto pressure_input_id() const noexcept ->
message_id {
77 constexpr
auto dampening_input_id() const noexcept ->
message_id {
91 constexpr
auto altitude_change_input_id() const noexcept ->
message_id {
101 altitude_change_input_id(),
105 constexpr
auto longitude_change_input_id() const noexcept ->
message_id {
115 longitude_change_input_id(),
119 constexpr
auto latitude_change_input_id() const noexcept ->
message_id {
129 latitude_change_input_id(),
154 bool _is_dragging{
false};
155 bool _dampen_motion{
false};
157 auto _motion_adjust() const noexcept {
158 return _dampen_motion ? 0.2 : 1.0;
161 void _handle_pressure(
const input& i);
162 void _handle_dampening(
const input& i);
163 void _change_altitude(
const input& i);
164 void _change_longitude(
const input& i);
165 void _change_latitude(
const input& i);
170 #if !EAGINE_LINK_LIBRARY || defined(EAGINE_IMPLEMENTING_LIBRARY)
171 #include <eagine/application/camera.inl>
Application harness / wrapper code is placed in this namespace.
Definition: eagine.hpp:72
Declaration of class template storing a reference to a callable object.
Definition: callable_ref.hpp:24
Read-only view of application context state values.
Definition: state_view.hpp:34
auto longitude_change_input() noexcept -> input_slot
Returns the input slot for handling azimuth change input signals. This can be bound for example to le...
Definition: camera.hpp:113
#define EAGINE_MSG_ID(API, NAME)
Macro for instantiating objects of static_message_id.
Definition: message_id.hpp:148
auto dampening_input() noexcept -> input_slot
Returns the input slot for handling motion dampening input signals. This can be bound for example to ...
Definition: camera.hpp:85
auto connect_inputs(execution_context &ec) -> orbiting_camera &
Connects the camera input slots to the execution context.
Primary template for conditionally valid values.
Definition: decl.hpp:49
auto matrix(video_context &vc) const noexcept
Construction from a reference to a video context.
Definition: camera.hpp:27
auto altitude_change_input() noexcept -> input_slot
Returns the input slot for handling orbit change input signals. This can be bound for example to mous...
Definition: camera.hpp:99
auto basic_input_mapping(execution_context &ec) -> auto &
Specifies the default key binding for the camera input slots.
Definition: camera.hpp:144
auto has_changed() noexcept
Inddicates if the camera has changed and resets the flag.
Definition: camera.hpp:32
Class representing a camera orbiting around its target.
Definition: camera.hpp:23
auto update_pitch(float inc) noexcept -> orbiting_camera &
Does a generic elevation update with given increment.
auto latitude_change_input() noexcept -> input_slot
Returns the input slot for handling elevation change input signals. This can be bound for example to ...
Definition: camera.hpp:127
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.
auto update_turns(float inc) noexcept -> orbiting_camera &
Does a generic azimuth update with given increment.
#define EAGINE_THIS_MEM_FUNC_C(FUNC)
Macro for creating object of member_function_constant in member functions.
Definition: mem_func_const.hpp:206
auto basic_input_mapping(execution_context &ec, identifier mapping_id) -> orbiting_camera &
Specifies a named key binding for the camera input slots.
Extension of orbiting camera wrapper.
Definition: camera.hpp:20
Class holding video rendering-related application support objects.
Definition: context.hpp:34
auto matrix(float aspect) const noexcept
Returns the camera matrix (perspective * projection).
Definition: camera.hpp:128
Class storing two identifier values representing class/method pair.
Definition: message_id.hpp:25
auto update_orbit(float inc) noexcept -> orbiting_camera &
Does a generic orbit update with given increment.
Class holding shared video/audio rendering application support objects.
Definition: context.hpp:166
auto pressure_input() noexcept -> input_slot
Returns the input slot for handling cursor pressure input signals. This can be bound for example to m...
Definition: camera.hpp:71