Camera with projection and view matrices.
More...
|
| | Camera (float fov, float aspectRatio, float near, float far) |
| | Constructs a camera.
|
| |
|
void | Update () |
| | Calculates the projectionView matrix by multiplying the projection and view matricies.
|
| |
| Vector< float, 3 > | ToRay (uint32_t x, uint32_t y) |
| | Converts screen-space coordinates to a 3D world-space ray.
|
| |
|
|
MatrixRowMajor< float, 4, 4, 1 > | projection |
| |
|
MatrixRowMajor< float, 4, 4, 1 > | view |
| |
|
MatrixRowMajor< float, 4, 4, 1 > | projectionView |
| |
|
Event< void > | onUpdate |
| |
Camera with projection and view matrices.
◆ Camera()
| Crafter::Camera::Camera |
( |
float | fov, |
|
|
float | aspectRatio, |
|
|
float | near, |
|
|
float | far ) |
Constructs a camera.
- Parameters
-
| fov | Field of view in radians. |
| aspectRatio | Aspect ratio of the camera (width / height). |
| near | Near clipping plane. |
| far | Far clipping plane. |
◆ ToRay()
| Vector< float, 3 > Crafter::Camera::ToRay |
( |
uint32_t | x, |
|
|
uint32_t | y ) |
Converts screen-space coordinates to a 3D world-space ray.
- Parameters
-
| x | The x-coordinate on the screen (in pixels). |
| y | The y-coordinate on the screen (in pixels). |
- Returns
- A normalized 3D direction vector representing the ray from the camera.
The documentation for this class was generated from the following file:
- src/module/Crafter.Graphics-Camera.cppm