Buran Motion Planning Framework
camera.h
1 #pragma once
2 
3 #include <Eigen/Dense>
4 #include <GL/gl.h>
5 #include <GL/glut.h>
6 
7 #include "matrix_math.h"
8 #include "log.h"
9 
10 namespace bmpf {
11 
18  class Camera {
19  public:
23  Camera();
24 
31  Camera(Eigen::Vector3d _pos, Eigen::Vector3d _dir, Eigen::Vector3d _up) :
32  _pos(std::move(_pos)), _dir(std::move(_dir)), _up(std::move(_up)) {};
33 
38  Eigen::Vector3d getUp() { return _up; };
39 
44  Eigen::Vector3d getCenter() { return _pos; };
45 
50  Eigen::Vector3d getEye() { return _dir + _pos; }
51 
56  void rotateX(double alpha);
57 
62  void rotateY(double alpha);
63 
68  void moveLeft(double d);
69 
74  void moveRight(double d);
75 
80  void moveForward(double d) { _pos = _pos - _dir * d; }
81 
86  void moveBack(double d) { _pos = _pos + _dir * d; }
87 
92  void moveDown(double d) { _pos(2) -= d; }
93 
98  void moveUp(double d) { _pos(2) += d; }
99 
103  void applyLookAt();
104 
105  private:
109  Eigen::Vector3d _up;
113  Eigen::Vector3d _dir;
117  Eigen::Vector3d _pos;
118  };
119 
120 
121 }
bmpf::Camera::moveDown
void moveDown(double d)
Definition: camera.h:92
bmpf::Camera::moveForward
void moveForward(double d)
Definition: camera.h:80
bmpf::Camera::rotateY
void rotateY(double alpha)
Definition: camera.cpp:34
bmpf::Camera
Класс камеры
Definition: camera.h:18
bmpf::Camera::Camera
Camera(Eigen::Vector3d _pos, Eigen::Vector3d _dir, Eigen::Vector3d _up)
Definition: camera.h:31
bmpf::Camera::applyLookAt
void applyLookAt()
Definition: camera.cpp:67
bmpf::Camera::moveLeft
void moveLeft(double d)
Definition: camera.cpp:59
bmpf::Camera::rotateX
void rotateX(double alpha)
Definition: camera.cpp:18
bmpf::Camera::getEye
Eigen::Vector3d getEye()
Definition: camera.h:50
bmpf::Camera::getUp
Eigen::Vector3d getUp()
Definition: camera.h:38
bmpf::Camera::moveUp
void moveUp(double d)
Definition: camera.h:98
bmpf::Camera::Camera
Camera()
Definition: camera.cpp:8
bmpf::Camera::getCenter
Eigen::Vector3d getCenter()
Definition: camera.h:44
bmpf::Camera::moveRight
void moveRight(double d)
Definition: camera.cpp:50
bmpf::Camera::moveBack
void moveBack(double d)
Definition: camera.h:86