summaryrefslogtreecommitdiff
path: root/gfx
diff options
context:
space:
mode:
Diffstat (limited to 'gfx')
-rw-r--r--gfx/gl/camera.cpp1
-rw-r--r--gfx/gl/camera.h2
2 files changed, 2 insertions, 1 deletions
diff --git a/gfx/gl/camera.cpp b/gfx/gl/camera.cpp
index 72b5240..fadbfd7 100644
--- a/gfx/gl/camera.cpp
+++ b/gfx/gl/camera.cpp
@@ -23,4 +23,5 @@ Camera::updateView()
view = glm::lookAt(position, position + forward, up);
unView = glm::lookAt(::origin, forward, up);
viewProjection = projection * view;
+ inverseViewProjection = glm::inverse(viewProjection);
}
diff --git a/gfx/gl/camera.h b/gfx/gl/camera.h
index bcc7469..3182969 100644
--- a/gfx/gl/camera.h
+++ b/gfx/gl/camera.h
@@ -61,5 +61,5 @@ private:
float fov, aspect, near, far;
glm::mat4 projection;
glm::mat4 view, unView;
- glm::mat4 viewProjection;
+ glm::mat4 viewProjection, inverseViewProjection;
};