|
Gin
|
A 3D camera that can be positioned and oriented in space. More...
#include <gin_camera3d.h>
Public Member Functions | |
| Camera3D ()=default | |
| void | setPosition (const Vec3f &pos) |
| Sets the camera position. | |
| void | setPosition (float x, float y, float z) |
| Vec3f | getPosition () const |
| Gets the camera position. | |
| void | setTarget (const Vec3f &t) |
| Sets the point the camera is looking at. | |
| void | setTarget (float x, float y, float z) |
| Vec3f | getTarget () const |
| Gets the target point. | |
| void | setUpVector (const Vec3f &u) |
| Sets the up vector. | |
| Vec3f | getUpVector () const |
| Gets the up vector. | |
| void | setPerspective (float fovYDegrees, float aspectRatio, float nearPlane, float farPlane) |
| Sets up a perspective projection. | |
| const Mat4f & | getViewMatrix () const |
| Gets the view matrix (world to camera space). | |
| const Mat4f & | getProjectionMatrix () const |
| Gets the projection matrix. | |
| Mat4f | getViewProjectionMatrix () const |
| Gets the combined view-projection matrix. | |
| void | orbit (float deltaYaw, float deltaPitch) |
| Orbits the camera around the target point. | |
| void | zoom (float delta) |
| Zooms the camera (moves towards/away from target). | |
| void | pan (float deltaX, float deltaY) |
| Pans the camera (moves both position and target). | |
A 3D camera that can be positioned and oriented in space.
|
default |
| Vec3f Camera3D::getPosition | ( | ) | const |
Gets the camera position.
| Vec3f Camera3D::getTarget | ( | ) | const |
Gets the target point.
| Vec3f Camera3D::getUpVector | ( | ) | const |
Gets the up vector.
| void Camera3D::setPerspective | ( | float | fovYDegrees, |
| float | aspectRatio, | ||
| float | nearPlane, | ||
| float | farPlane | ||
| ) |
Sets up a perspective projection.
| fovYDegrees | Field of view in degrees |
| aspectRatio | Width / height |
| nearPlane | Near clipping plane distance |
| farPlane | Far clipping plane distance |
Gets the view matrix (world to camera space).
References Mat4< float >::lookAt().
Referenced by getViewProjectionMatrix().
Gets the projection matrix.
References Mat4< float >::perspective().
Referenced by getViewProjectionMatrix().
| Mat4f Camera3D::getViewProjectionMatrix | ( | ) | const |
Gets the combined view-projection matrix.
References getProjectionMatrix(), and getViewMatrix().
Orbits the camera around the target point.
| deltaYaw | Horizontal rotation in radians |
| deltaPitch | Vertical rotation in radians |
References Vec3< T >::length(), Point< T >::x, Vec3< T >::x, Point< T >::y, Vec3< T >::y, and Vec3< T >::z.
Zooms the camera (moves towards/away from target).
| delta | Positive zooms in, negative zooms out |
References Vec3< T >::length(), and Vec3< T >::normalized().
Pans the camera (moves both position and target).
| deltaX | Horizontal movement |
| deltaY | Vertical movement |
References Vec3< T >::cross().