MayaFlux 0.4.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ apply_orbit_pan()

MAYAFLUX_API void MayaFlux::Kinesis::apply_orbit_pan ( OrbitState state,
float  dx,
float  dy 
)

Pan the focal point in the camera's local right/up plane.

Delta is scaled by distance so pan speed stays proportionate to zoom level.

Parameters
stateOrbit state (focal mutated).
dxHorizontal pixel delta.
dyVertical pixel delta.

Definition at line 52 of file OrbitState.cpp.

53{
54 const glm::vec3 forward = glm::normalize(st.focal - orbit_eye(st));
55 const glm::vec3 right = glm::normalize(glm::cross(forward, glm::vec3(0.0F, 1.0F, 0.0F)));
56 const glm::vec3 up = glm::normalize(glm::cross(right, forward));
57
58 const float scale = st.distance * st.pan_sensitivity;
59 st.focal -= right * (dx * scale);
60 st.focal += up * (dy * scale);
61}
glm::vec3 orbit_eye(const OrbitState &st)
Derive eye position from the current orbit state.
Tendency< D, float > scale(const Tendency< D, float > &t, float factor)
Uniform scaling of a scalar-output tendency.
Definition Tendency.hpp:97

References MayaFlux::Kinesis::OrbitState::distance, MayaFlux::Kinesis::OrbitState::focal, orbit_eye(), MayaFlux::Kinesis::OrbitState::pan_sensitivity, and scale().

Referenced by MayaFlux::bind_orbit_preset().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: