PeriDyno 1.0.0
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
OrbitCamera.h
Go to the documentation of this file.
1
16#pragma once
17
18#include "Camera.h"
19
20namespace dyno
21{
22 class OrbitCamera : public Camera {
23
24 public:
27
28 void rotateToPoint(float x, float y) override;
29 void translateToPoint(float x, float y) override;
30 void zoom(float amount) override;
31
32 void registerPoint(float x, float y) override;
33
34 Vec3f getViewDir() const;
35 Vec3f getEyePos() const override;
36 Vec3f getTargetPos() const override;
37
38 void setEyePos(const Vec3f& p) override;
39 void setTargetPos(const Vec3f& p) override;
40
41 void getCoordSystem(Vec3f &view, Vec3f &up, Vec3f &right) const;
42
43 glm::mat4 getViewMat() override;
44 glm::mat4 getProjMat() override;
45
46 private:
47 void rotate(float dx, float dy);
48 void translate(const Vec3f translation);
49
50 Vec3f getPosition(float x, float y);
51 Quat1f getQuaternion(float x1, float y1, float x2, float y2);
52
53 Quat1f getQuaternion(float yaw, float pitch) const;
54
55 private:
56 float mRegX = 0.5f;
57 float mRegY = 0.5f;
58
59 //Auxiliary parameters to form a right-hand coordinate or left-hand side coordinate
60 float mRotAngle = 0.0f;
61 Vec3f mRotAxis = Vec3f(0.0f, 1.0f, 0.0f);
62
63 float mYaw = 0.0f; //along Y
64 float mPitch = 0.0f; //along axis X of the viewport coordinate system
65
67
70
71 float mFocusDistMax = 10.0f;
72 float mFocusDistMin = 0.1f;
73
74 float mSpeed = 2.0;
75 float mZoomSpeed = 1.0f;
76 };
77
78}
79
Vec3f getViewDir() const
glm::mat4 getViewMat() override
void getCoordSystem(Vec3f &view, Vec3f &up, Vec3f &right) const
Vec3f getPosition(float x, float y)
Vec3f getEyePos() const override
void rotateToPoint(float x, float y) override
void translate(const Vec3f translation)
glm::mat4 getProjMat() override
void zoom(float amount) override
void translateToPoint(float x, float y) override
void registerPoint(float x, float y) override
void setTargetPos(const Vec3f &p) override
void setEyePos(const Vec3f &p) override
void rotate(float dx, float dy)
Vec3f getTargetPos() const override
Quat1f getQuaternion(float x1, float y1, float x2, float y2)
This is an implementation of AdditiveCCD based on peridyno.
Definition Array.h:25
Quat< float > Quat1f
Definition Quat.h:136
Vector< float, 3 > Vec3f
Definition Vector3D.h:93