From f2f8ccc1c24ab372ffe5e932780eeb1c49a4d277 Mon Sep 17 00:00:00 2001 From: dec05eba Date: Fri, 21 Feb 2020 05:10:13 +0100 Subject: Add third person camera (orbit camera) --- include/ThirdPersonCamera.hpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 include/ThirdPersonCamera.hpp (limited to 'include') diff --git a/include/ThirdPersonCamera.hpp b/include/ThirdPersonCamera.hpp new file mode 100644 index 0000000..00a22a4 --- /dev/null +++ b/include/ThirdPersonCamera.hpp @@ -0,0 +1,23 @@ +#pragma once + +#include + +namespace amalgine { + class ThirdPersonCamera { + public: + ThirdPersonCamera(); + + void zoom(float distance); + void rotate_horizontal(float radians); + void rotate_vertical(float radians); + void set_target_position(const glm::vec3 &target_pos); + glm::mat4 get_matrix() const; + glm::vec3 get_forward_vector() const; + glm::vec3 get_right_vector() const; + private: + glm::vec3 target_pos; + float camera_distance; + float angle_horizontal; + float angle_vertical; + }; +} \ No newline at end of file -- cgit v1.2.3