8 #ifndef _MBS_VIEW_POINT_HH_
9 #define _MBS_VIEW_POINT_HH_
11 #ifndef degreesToRadians
12 #define degreesToRadians(x) x*(3.141592f/180.0f)
15 #ifndef GLM_FORCE_RADIANS
16 #define GLM_FORCE_RADIANS
32 MbsViewPoint(glm::vec3
const&rel_pos, glm::vec3
const&rel_look_at, glm::vec3
const&z_up, MbsWorld3D *world_3d,
33 bool pers_flag=
true,
float FoV_scale=0.785f,
float camera_near=0.1f,
float camera_far=100.0f,
34 glm::mat4
const& parent_mat = glm::mat4(1.0f));
35 virtual ~MbsViewPoint();
38 glm::mat4 GetViewMatrix()
const {
return view_mat; }
41 glm::mat4 GetProjectionMatrix()
const {
return proj_mat; }
44 glm::vec3 GetPosition()
const {
return position; }
47 glm::vec3 GetParentPosition()
const {
return glm::vec3(parent_mat[3][0], parent_mat[3][1], parent_mat[3][2]); }
50 void UpdateParentPos(glm::mat4
const& parent_mat) { this->parent_mat = parent_mat; }
53 glm::mat4
const& GetPosMat() {
return posMat; }
56 void UpdatePosMat(glm::mat4
const& posMat) { this->posMat = posMat; }
59 glm::mat4
const& GetRotMat() {
return rotMat; }
62 void UpdateRotMat(glm::mat4
const& rotMat) { this->rotMat = rotMat; }
65 void SetWinSize(
int x_width,
int y_width);
68 bool GetPerspectiveMode(){
return this->pers_flag;}
71 void SetPerspectiveMode(
bool flag){this->pers_flag=flag;}
74 void UpdateMatrices();
75 void ScaleFactor(
float factor);
77 virtual void UpdateView();
101 float semi_x_width_f;
102 float semi_y_width_f;
112 glm::mat4 parent_mat;
115 void UpdateProjection();
116 void UpdateScale(
float scale);
124 glm::mat4 ParentApply(glm::mat4
const& child_look_at, glm::mat4
const& parent_joint);