20#ifndef YOURGAME_CAMERA_H
21#define YOURGAME_CAMERA_H
23#define GLM_ENABLE_EXPERIMENTAL
39 glm::mat4
pMat(
float zNear,
float zFar);
41 void setPerspective(
float fovy,
float aspect,
float zNear,
float zFar);
42 void setOrthographic(
float height,
float aspect,
float zNear,
float zFar);
50 void castRay(
float viewportX,
float viewportY, glm::vec3 &dstOrg, glm::vec3 &dstDir);
56 float m_height = 1.0f;
57 float m_aspect = 1.0f;
60 glm::mat4 m_pMat = glm::mat4(1.0f);
61 bool m_pMatInvalidated =
false;
62 void updatePMatIfInvalidated();
63 glm::mat4 calcPMat(
float zNear,
float zFar);
67 float m_firstPersonYaw = 0.0f;
68 float m_firstPersonPitch = 0.0f;
69 glm::mat4 m_vMat = glm::mat4(1.0f);
70 bool m_vMatInvalidated =
false;
71 void updateVMatIfInvalidated();
void setZFar(float zFar)
Definition camera.cpp:109
Trafo * trafo()
Definition camera.cpp:44
void setPerspective(float fovy, float aspect, float zNear, float zFar)
Definition camera.cpp:59
void setAspect(float aspect)
Definition camera.cpp:97
void castRay(float viewportX, float viewportY, glm::vec3 &dstOrg, glm::vec3 &dstDir)
viewportX,viewportY in [0.0,1.0]
Definition camera.cpp:124
glm::mat4 pMat()
Definition camera.cpp:33
void setZNear(float zNear)
Definition camera.cpp:103
void setOrthographic(float height, float aspect, float zNear, float zFar)
Definition camera.cpp:69
glm::mat4 vMat()
Definition camera.cpp:27
void setProjection(math::Projection proj)
Definition camera.cpp:50
void setFovy(float fovy)
Definition camera.cpp:79
void rotateFirstPerson(float yaw, float pitch)
Definition camera.cpp:115
void setHeight(float height)
Definition camera.cpp:88
Projection
Definition math.h:28