X-Git-Url: http://git.localhorst.tv/?p=blobs.git;a=blobdiff_plain;f=src%2Fgraphics%2Fviewport.cpp;h=a3189314f2e58f7bf4ceec2585c61d4b0882e629;hp=e4a29278babc60e703fdfe7d5911d2751cb1399c;hb=ea55fc457b7d0068225af447da4a5c5489ccd239;hpb=7159e493b63552ec7de1fceec4abcb7e0e099ec0 diff --git a/src/graphics/viewport.cpp b/src/graphics/viewport.cpp index e4a2927..a318931 100644 --- a/src/graphics/viewport.cpp +++ b/src/graphics/viewport.cpp @@ -81,6 +81,12 @@ glm::mat4 Camera::Model(const world::Body &b) const noexcept { } } +glm::mat4 Camera::Universe() const noexcept { + return glm::mat4(track_orient + ? ref->InverseTransform() * ref->ToUniverse() + : ref->ToUniverse()); +} + void Camera::UpdateProjection() noexcept { projection = glm::infinitePerspective(fov, aspect, near); }