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

◆ build_view_transform()

ViewTransform MayaFlux::Kinesis::build_view_transform ( const NavigationState state,
float  aspect 
)

Build a ViewTransform from the current NavigationState without mutating it.

Pure read of eye, yaw, pitch, fov_radians, near_plane, far_plane. Does not advance the eye or update last_tick. Call advance_navigation() first when the eye needs to move.

Parameters
stateNavigation state (read-only)
aspectFramebuffer width / height
Returns
ViewTransform ready for push constant upload

Definition at line 111 of file NavigationState.cpp.

112{
113 const glm::vec3 forward {
114 std::cos(st.pitch) * std::sin(st.yaw),
115 std::sin(st.pitch),
116 std::cos(st.pitch) * std::cos(st.yaw)
117 };
118
119 return {
120 .view = glm::lookAt(st.eye, st.eye + forward, glm::vec3(0.0F, 1.0F, 0.0F)),
121 .projection = glm::perspective(st.fov_radians, aspect, st.near_plane, st.far_plane)
122 };
123}

References MayaFlux::Kinesis::NavigationState::eye, MayaFlux::Kinesis::NavigationState::far_plane, MayaFlux::Kinesis::NavigationState::fov_radians, MayaFlux::Kinesis::NavigationState::near_plane, MayaFlux::Kinesis::NavigationState::pitch, MayaFlux::Kinesis::ViewTransform::view, and MayaFlux::Kinesis::NavigationState::yaw.

Referenced by MayaFlux::bind_screenspace_preset(), compute_view_transform(), and MayaFlux::Nexus::Locus::invoke_perception().

+ Here is the caller graph for this function: