X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgraphics%2Fviewport.cpp;h=636f3c35c1015f9cc9612ef9d62c4f592d740692;hb=2025d49798b93180237b6ce62d3ff5d6ee8ebc6e;hp=2d9b469236a07d8f2ce84da43d014530836c09e7;hpb=cacc0641e5174d8b46e7a7086be6a45c87ab3642;p=blobs.git diff --git a/src/graphics/viewport.cpp b/src/graphics/viewport.cpp index 2d9b469..636f3c3 100644 --- a/src/graphics/viewport.cpp +++ b/src/graphics/viewport.cpp @@ -120,8 +120,9 @@ glm::mat4 Camera::Model(const world::Body &b) const noexcept { ? ref->InverseTransform() * ref->ToParent() * b.LocalTransform() : ref->ToParent() * b.LocalTransform(); } else { - // TODO: model matrices for path distances > 1 - return track_orient ? glm::mat4(1.0f) : glm::mat4(ref->LocalTransform()); + return track_orient + ? ref->InverseTransform() * ref->ToUniverse() * b.FromUniverse() * b.LocalTransform() + : ref->ToUniverse() * b.FromUniverse() * b.LocalTransform(); } } @@ -151,5 +152,9 @@ void Viewport::Clear() { glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); } +void Viewport::ClearDepth() { + glClear(GL_DEPTH_BUFFER_BIT); +} + } }