]> git.localhorst.tv Git - blank.git/blobdiff - src/shader.cpp
move controller from camera to world
[blank.git] / src / shader.cpp
index e01c11fcc1aac8f282aaaec1804d9eb32f708ca6..43b3910096789bb4aaece8133abd8ac2b42e75a4 100644 (file)
@@ -211,7 +211,19 @@ void DirectionalLighting::SetLightDirection(const glm::vec3 &dir) {
        glUniform3f(light_direction_handle, light_direction.x, light_direction.y, light_direction.z);
 }
 
+void DirectionalLighting::SetProjection(const glm::mat4 &p) {
+       projection = p;
+       vp = p * view;
+}
+
+void DirectionalLighting::SetView(const glm::mat4 &v) {
+       view = v;
+       vp = projection * v;
+}
+
 void DirectionalLighting::SetVP(const glm::mat4 &v, const glm::mat4 &p) {
+       projection = p;
+       view = v;
        vp = p * v;
 }