|
| static Camera | fit (const BoundingVolumes::AABBT< T > &a_box, const Vec3T< T > &a_up=Vec3T< T >(T(0), T(1), T(0))) |
| | A camera that sees the whole of a box, from the default direction.
|
| |
| static Camera | fit (const BoundingVolumes::AABBT< T > &a_box, View a_view, const Vec3T< T > &a_up=Vec3T< T >(T(0), T(1), T(0))) |
| | A camera that sees the whole of a box, from a given direction.
|
| |
| static Camera | lookAt (const Vec3T< T > &a_eye, const Vec3T< T > &a_target, const Vec3T< T > &a_up=Vec3T< T >(T(0), T(1), T(0)), const T a_fieldOfView=T(40)) |
| | A camera at a given eye, looking at a given point.
|
| |
|
|
Vec3T< T > | m_target = Vec3T<T>::zeros() |
| | The point the camera looks at.
|
| |
|
T | m_yaw = T(35) |
| | Degrees about the up axis.
|
| |
|
T | m_pitch = T(25) |
| | Degrees above the plane perpendicular to the up axis, from -90 to 90.
|
| |
|
T | m_distance = T(4) |
| | Distance from the eye to the target.
|
| |
|
T | m_fieldOfView = T(40) |
| | Vertical field of view, in degrees.
|
| |
|
Vec3T< T > | m_up = Vec3T<T>(T(0), T(1), T(0)) |
| | The up axis (need not be of unit length).
|
| |
| bool | m_orthographic = false |
| | Parallel rays instead of rays from the eye: no perspective, so sizes do not shrink with distance.
|
| |
|
T | m_nearClip = T(0) |
| | How far along each camera ray it starts (0: at the eye): anything nearer is not seen.
|
| |
template<class T>
struct EBGeometry::Render::Camera< T >
A camera orbiting a target point.
The eye sits m_distance from m_target, in the direction given by m_yaw (degrees about the up axis) and m_pitch (degrees above the plane perpendicular to it). With the default up axis +y, yaw 0 looks from +z and yaw 90 from +x. fit() aims it at a box, lookAt() places it directly. The image's right follows the yaw alone, so the camera may look straight along the up axis (pitch 90 or -90).
- Template Parameters
-
| T | Floating-point precision. |
Parallel rays instead of rays from the eye: no perspective, so sizes do not shrink with distance.
The view is as tall as the perspective view is at the target (2 m_distance tan(m_fieldOfView / 2)), so switching keeps the target's size, and zooming (a shorter m_distance) narrows it. The rays start behind the shape's box, so that the whole shape is seen however close the eye is; m_nearClip is measured from the plane through the eye.