Implement class RenderableTrailNew and use it for osiris rex. Higher precision than the old one.

This commit is contained in:
Kalle Bladin
2016-08-23 17:29:51 -04:00
parent 6875e8c1c7
commit 57d47cd856
10 changed files with 740 additions and 69 deletions

View File

@@ -166,7 +166,9 @@ void RenderableTrail::render(const RenderData& data) {
// Model transform and view transform needs to be in double precision
glm::dmat4 modelTransform =
glm::translate(glm::dmat4(1.0), bodyPosition); // Only care about translation
glm::translate(glm::dmat4(1.0), bodyPosition) *
glm::dmat4(data.modelTransform.rotation) * // Spice rotation
glm::dmat4(glm::scale(glm::dmat4(1.0), glm::dvec3(data.modelTransform.scale)));
glm::dmat4 modelViewTransform = data.camera.combinedViewMatrix() * modelTransform;
_programObject->setUniform("modelViewTransform", glm::mat4(modelViewTransform));