VolViz
A volume visualization tool
|
#include <Camera.h>
Public Member Functions | |
Camera () noexcept | |
Private_::CameraClient | client () const noexcept |
DepthRange | depthRange () const noexcept |
Public Attributes | |
Property< Orientation > | orientation {Orientation::Identity()} |
The camera's orientation. More... | |
Property< PhysicalPosition > | position |
Property< Angle > | verticalFieldOfView {110 * degree_angle} |
Vertical field of view in rad. More... | |
Property< float > | aspectRatio {4.f / 3.f} |
Aspect ratio (width / height) or horizontal FOV / vertical FOV. More... | |
Private Types | |
template<class T > | |
using | Property = AtomicWrapper< T, SetAndNotifyPolicy > |
Private Member Functions | |
Matrix4 | projectionMatrix () const noexcept |
Returns the camera's projection matrix. More... | |
Matrix4 | viewMatrix () const noexcept |
Returns the camera's view matrix, i.e. the inverse camera transform. More... | |
Matrix4 | viewProjectionMatrix () const noexcept |
Returns the product of projectionMatrix() * viewMatrix(...) More... | |
Position | unproject (Position2 const &screenPos, float depth, Length ambientScale) const noexcept |
Private Attributes | |
AtomicCache< Matrix4 > | cachedProjectionMatrix_ |
Cached projection matrix. More... | |
AtomicCache< Matrix4 > | cachedViewMatrix_ |
Cached view Matrix. More... | |
AtomicCache< Matrix4 > | cachedViewProjectionMatrix_ |
Cached product viewMatrix * projectionMatrix. More... | |
AtomicCache< Angle > | cachedVerticalFOV_ |
Cached vertical FOV. More... | |
Length | cachedScale_ |
Cached scale of last call to viewMatrix(...) More... | |
Friends | |
class | Private_::CameraClient |
Basic camera class. The camera has a physical location, an orientation and a field of view. The field of view is specified as the horizontal FOV, the vertical FOV is computed from the apect radius.
|
private |
|
noexcept |
|
noexcept |
Returns a client object that can be used to access cached projection and view matrices, as well as methods like unprojecting.
|
inlinenoexcept |
Returns the depth range of the camera projection, i.e. the depth value of the nearest possible value (near plane) and the value of the farest possible depth value (far plane),
|
privatenoexcept |
Returns the camera's projection matrix.
|
privatenoexcept |
Unprojects a point in screen coordinates with known depth into the 3D scene
screenPos | the source point in screen coordinate system, i.e. (-1, -1) is the bottom left, (1, 1) is the top right |
depth | the depth of the pixel at screenPos |
ambientScale | the physical length of one unit in the target 3D space |
|
privatenoexcept |
Returns the camera's view matrix, i.e. the inverse camera transform.
|
privatenoexcept |
Returns the product of projectionMatrix() * viewMatrix(...)
|
friend |
Aspect ratio (width / height) or horizontal FOV / vertical FOV.
|
mutableprivate |
Cached projection matrix.
|
mutableprivate |
Cached scale of last call to viewMatrix(...)
|
mutableprivate |
Cached vertical FOV.
|
mutableprivate |
Cached view Matrix.
|
mutableprivate |
Cached product viewMatrix * projectionMatrix.
Property<Orientation> VolViz::Camera::orientation {Orientation::Identity()} |
The camera's orientation.
Property<PhysicalPosition> VolViz::Camera::position |
Position of the camera plane in space, i.e. the orientation of the camera projection plane's normal
Vertical field of view in rad.