diff options
author | dec05eba <dec05eba@protonmail.com> | 2020-02-21 05:10:13 +0100 |
---|---|---|
committer | dec05eba <dec05eba@protonmail.com> | 2021-11-18 15:22:10 +0100 |
commit | f2f8ccc1c24ab372ffe5e932780eeb1c49a4d277 (patch) | |
tree | a47396c0024b14963e016091e6114af98bc287c7 /include | |
parent | c794de8eeac935649aa556f009776567ed201787 (diff) |
Add third person camera (orbit camera)
Diffstat (limited to 'include')
-rw-r--r-- | include/ThirdPersonCamera.hpp | 23 |
1 files changed, 23 insertions, 0 deletions
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 <glm/glm.hpp> + +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 |