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

◆ apply_orbit_rotate()

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

Apply a mouse delta to azimuth and elevation.

Elevation is clamped to [-89, +89] degrees to avoid gimbal lock at the poles.

Parameters
stateOrbit state (azimuth, elevation mutated).
dxHorizontal pixel delta (positive = right).
dyVertical pixel delta (positive = down).

Definition at line 37 of file OrbitState.cpp.

38{
39 st.azimuth += dx * st.rotate_sensitivity;
40 st.elevation += dy * st.rotate_sensitivity;
41
42 static constexpr float k_limit = glm::radians(89.0F);
43 st.elevation = glm::clamp(st.elevation, -k_limit, k_limit);
44}

References MayaFlux::Kinesis::OrbitState::azimuth, MayaFlux::Kinesis::OrbitState::elevation, and MayaFlux::Kinesis::OrbitState::rotate_sensitivity.

Referenced by MayaFlux::bind_orbit_preset().

+ Here is the caller graph for this function: