|
WoW Model Viewer
Your premiere tool for viewing, equipping and animating World of Warcraft models.
|
Orbit camera that revolves around a target point. More...
#include <OrbitCamera.h>
Public Member Functions | |
| OrbitCamera () | |
| glm::mat4 | getViewMatrix () const |
| Compute the current view matrix from yaw, pitch, and radius. | |
| void | reset () |
| Reset all parameters to defaults. | |
| void | resetFromBounds (float zMin, float zMax, float fovDegrees) |
| Reset the camera to frame a model whose bounding box spans [zMin, zMax]. | |
| void | setPosition (const glm::vec3 &position) |
| Set the camera world position directly. | |
| glm::vec3 | position () const |
| Current camera world position. | |
| glm::vec3 | right () const |
| Camera right vector (perpendicular to view direction and up). | |
| void | setYaw (float yaw) |
| Set the yaw angle (horizontal rotation around the target). | |
| void | setPitch (float pitch) |
| Set the pitch angle (vertical elevation). | |
| void | setYawAndPitch (float yaw, float pitch) |
| Set both yaw and pitch simultaneously. | |
| float | yaw () const |
| Current yaw angle in radians. | |
| float | pitch () const |
| Current pitch angle in radians. | |
| void | setLookAt (const glm::vec3 &target) |
| Set the point the camera orbits around. | |
| glm::vec3 | lookAt () const |
| Current orbit target position. | |
| void | setRadius (float radius) |
| Set the distance from the camera to the target. | |
| float | radius () const |
| Current orbit radius (distance to target). | |
Private Member Functions | |
| void | updatePosition () |
Private Attributes | |
| glm::vec3 | pos_ |
| glm::vec3 | target_ |
| glm::vec3 | up_ |
| glm::vec3 | right_ |
| float | yaw_ |
| float | pitch_ |
| float | radius_ |
Orbit camera that revolves around a target point.
Controlled by yaw, pitch, and radius parameters. The view matrix is recomputed from these each time getViewMatrix() is called.
Definition at line 9 of file OrbitCamera.h.
| OrbitCamera::OrbitCamera | ( | ) |
| glm::mat4 OrbitCamera::getViewMatrix | ( | ) | const |
Compute the current view matrix from yaw, pitch, and radius.
Definition at line 22 of file OrbitCamera.cpp.
|
inline |
Current orbit target position.
Definition at line 54 of file OrbitCamera.h.
|
inline |
Current pitch angle in radians.
Definition at line 48 of file OrbitCamera.h.
|
inline |
Current camera world position.
Definition at line 30 of file OrbitCamera.h.
|
inline |
Current orbit radius (distance to target).
Definition at line 60 of file OrbitCamera.h.
| void OrbitCamera::reset | ( | ) |
Reset all parameters to defaults.
Definition at line 27 of file OrbitCamera.cpp.
| void OrbitCamera::resetFromBounds | ( | float | zMin, |
| float | zMax, | ||
| float | fovDegrees | ||
| ) |
Reset the camera to frame a model whose bounding box spans [zMin, zMax].
| zMin | Minimum Z of the bounding box. |
| zMax | Maximum Z of the bounding box. |
| fovDegrees | Vertical field-of-view in degrees. |
Definition at line 38 of file OrbitCamera.cpp.
|
inline |
Camera right vector (perpendicular to view direction and up).
Definition at line 33 of file OrbitCamera.h.
| void OrbitCamera::setLookAt | ( | const glm::vec3 & | target | ) |
Set the point the camera orbits around.
Definition at line 51 of file OrbitCamera.cpp.
| void OrbitCamera::setPitch | ( | float | pitch | ) |
Set the pitch angle (vertical elevation).
Definition at line 88 of file OrbitCamera.cpp.
| void OrbitCamera::setPosition | ( | const glm::vec3 & | position | ) |
Set the camera world position directly.
Definition at line 63 of file OrbitCamera.cpp.
| void OrbitCamera::setRadius | ( | float | radius | ) |
Set the distance from the camera to the target.
Definition at line 57 of file OrbitCamera.cpp.
| void OrbitCamera::setYaw | ( | float | yaw | ) |
Set the yaw angle (horizontal rotation around the target).
Definition at line 82 of file OrbitCamera.cpp.
| void OrbitCamera::setYawAndPitch | ( | float | yaw, |
| float | pitch | ||
| ) |
Set both yaw and pitch simultaneously.
Definition at line 68 of file OrbitCamera.cpp.
|
private |
|
inline |
Current yaw angle in radians.
Definition at line 45 of file OrbitCamera.h.
|
private |
Definition at line 71 of file OrbitCamera.h.
|
private |
Definition at line 65 of file OrbitCamera.h.
|
private |
Definition at line 72 of file OrbitCamera.h.
|
private |
Definition at line 68 of file OrbitCamera.h.
|
private |
Definition at line 66 of file OrbitCamera.h.
|
private |
Definition at line 67 of file OrbitCamera.h.
|
private |
Definition at line 70 of file OrbitCamera.h.