#include "Camera.hpp"
#include "Viewport.hpp"
-#include "../const.hpp"
+#include "../math/const.hpp"
#include "../world/Body.hpp"
#include <cmath>
? 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();
}
}
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
}
+void Viewport::ClearDepth() {
+ glClear(GL_DEPTH_BUFFER_BIT);
+}
+
}
}