From ce60561dfdb3d3cb583bcc38cbcb93b9cd1b13a6 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Tue, 26 Jan 2021 21:13:41 +0000 Subject: Basic mouse navigation --- gfx/gl/camera.cpp | 6 ++++++ gfx/gl/camera.h | 1 + 2 files changed, 7 insertions(+) (limited to 'gfx') 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 @@ -19,6 +19,12 @@ Camera::MoveForward(float amt) pos += forward * amt; } +void +Camera::SlideForward(float amt) +{ + pos += forward * amt * glm::vec3 {1, 0, 1}; +} + void Camera::MoveRight(float 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); -- cgit v1.2.3