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

◆ compute_orbit_view_transform()

MAYAFLUX_API ViewTransform MayaFlux::Kinesis::compute_orbit_view_transform ( const OrbitState state,
float  aspect 
)

Build a ViewTransform from the current OrbitState.

Pure read; does not mutate state.

Parameters
stateOrbit state.
aspectFramebuffer width / height.
Returns
ViewTransform ready for push constant upload.

Definition at line 28 of file OrbitState.cpp.

29{
30 const glm::vec3 eye = orbit_eye(st);
31 return {
32 .view = glm::lookAt(eye, st.focal, glm::vec3(0.0F, 1.0F, 0.0F)),
33 .projection = glm::perspective(st.fov_radians, aspect, st.near_plane, st.far_plane)
34 };
35}
glm::vec3 orbit_eye(const OrbitState &st)
Derive eye position from the current orbit state.

References MayaFlux::Kinesis::OrbitState::far_plane, MayaFlux::Kinesis::OrbitState::focal, MayaFlux::Kinesis::OrbitState::fov_radians, MayaFlux::Kinesis::OrbitState::near_plane, and orbit_eye().

Referenced by MayaFlux::bind_orbit_preset().

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