Update SceneGraphNode to have a full transformation defined in terms of translation, scale and rotation.

This commit is contained in:
Kalle Bladin
2016-08-17 00:19:25 -04:00
parent c55872d5f4
commit 542b9e11e6
11 changed files with 296 additions and 157 deletions

View File

@@ -211,11 +211,10 @@ void RenderableModel::render(const RenderData& data) {
glm::dmat4 modelTransform =
glm::translate(glm::dmat4(1.0), data.positionVec3) * // Translation
glm::dmat4(data.rotation) * // Spice rotation
glm::dmat4(glm::scale(glm::dmat4(1.0), glm::dvec3(data.scale)));
debugModelRotation; // debug model rotation controlled from GUI
glm::dmat4 modelViewTransform = data.camera.combinedViewMatrix() * modelTransform;
glm::vec3 directionToSun = glm::normalize(_sunPos - data.positionVec3);
glm::vec3 directionToSunViewSpace = glm::mat3(data.camera.combinedViewMatrix()) * directionToSun;