10 this->direction = glm::normalize(
direction);
52 glm::mat3 rot = glm::mat3(glm::rotate(angle,
up));
58 glm::mat3 rot = glm::mat3(glm::rotate(angle,
direction));
59 up = glm::normalize(rot *
up);
64 glm::mat3 rot = glm::mat3(glm::rotate(angle,
right));
66 up = glm::normalize(rot *
up);
float far_plane
The far plane of the camera frustum.
void move_forward(float delta)
Move the camera along the forward vector.
void move_by(float x, float y, float z)
Move the camera by the vector (x, y, z)
float height
Viewport height.
glm::vec3 right
The right vector of the camera.
float width
Viewport width.
glm::mat4 view_matrix
The view matrix.
glm::vec3 direction
The direction the camera is pointing.
void pitch(float angle)
Rotate the camera using the right vector as the axis.
glm::vec3 up
The up vector of the camera.
void roll(float angle)
Rotate the camera using the forward vector as the axis.
glm::vec3 position
The camera position.
Camera(glm::vec3 position, glm::vec3 direction, glm::vec3 up)
void move_right(float delta)
Move the camera along the right vector.
float near_plane
The near plane of the camera frustum.
float fovy
The vertical field of view angle of the camera.
void update_view_matrix()
Recalculates the view matrix.
void yaw(float angle)
Rotate the camera using the up vector as the axis.
void move_up(float delta)
Move the camera along the up vector.