summaryrefslogtreecommitdiff
path: root/gfx/gl
diff options
context:
space:
mode:
Diffstat (limited to 'gfx/gl')
-rw-r--r--gfx/gl/camera.cpp6
-rw-r--r--gfx/gl/camera.h1
2 files changed, 7 insertions, 0 deletions
diff --git a/gfx/gl/camera.cpp b/gfx/gl/camera.cpp
index b4a76d0..2f48ca5 100644
--- a/gfx/gl/camera.cpp
+++ b/gfx/gl/camera.cpp
@@ -20,6 +20,12 @@ Camera::MoveForward(float amt)
}
void
+Camera::SlideForward(float amt)
+{
+ pos += forward * amt * glm::vec3 {1, 0, 1};
+}
+
+void
Camera::MoveRight(float amt)
{
pos += glm::cross(up, forward) * amt;
diff --git a/gfx/gl/camera.h b/gfx/gl/camera.h
index fa4296d..90d88a3 100644
--- a/gfx/gl/camera.h
+++ b/gfx/gl/camera.h
@@ -10,6 +10,7 @@ public:
[[nodiscard]] glm::mat4 GetViewProjection() const;
void MoveForward(float amt);
+ void SlideForward(float amt);
void MoveRight(float amt);
void Pitch(float angle);
void RotateY(float angle);