Game Physics Template 1.0
A template for game physics in C++ WEBGPU
|
Public Member Functions | |
void | update () |
Camera update function, called once per frame. Specifies the camera behavior. | |
glm::vec3 | forward () |
Forward vector of the current camera rotation. | |
glm::vec3 | up () |
Up vector of the current camera rotation. | |
glm::vec3 | right () |
Right vector of the current camera rotation. | |
glm::mat4 | projectionMatrix () |
The projection matrix of the camera. | |
void | lookAt (glm::vec3 target) |
Update the camera view matrix by looking at the target from the current position with the up vector (0,0,1) | |
float | aspectRatio () |
Compute the aspect ratio of the window. | |
Public Attributes | |
glm::vec3 | position |
Camera viewpoint. | |
float | fov |
Field of view in degrees. | |
float | near |
Near clipping plane. | |
float | far |
Far clipping plane. | |
int | width |
Width of the window. | |
int | height |
Height of the window. | |
glm::mat4 | viewMatrix |
The view matrix of the camera. | |
void Camera::update | ( | ) |
Camera update function, called once per frame. Specifies the camera behavior.
Updates the camera position and rotation based on user input. Edit this function for different camera behavior.