Inviwo  0.9.10.1
Inviwo documentation
inviwo::SkewedPerspectiveCamera Class Reference

Camera with off axis perspective projection. More...

#include <camera.h>

+ Inheritance diagram for inviwo::SkewedPerspectiveCamera:

Public Member Functions

 SkewedPerspectiveCamera (vec3 lookFrom=vec3(0.0f, 0.0f, 2.0f), vec3 lookTo=vec3(0.0f), vec3 lookUp=vec3(0.0f, 1.0f, 0.0f), float nearPlane=0.01f, float farPlane=10000.0f, vec4 frustum=vec4(-01, 10, -10, 10), vec2 frustumOffset=vec2(0.0f, 0.0f))
 
 SkewedPerspectiveCamera (const SkewedPerspectiveCamera &other)=default
 
SkewedPerspectiveCameraoperator= (const SkewedPerspectiveCamera &other)=default
 
virtual SkewedPerspectiveCameraclone () const override
 
virtual bool update (const Camera *source) override
 
virtual void configureProperties (CompositeProperty *comp, Config config) override
 
const vec4 & getFrustum () const
 
void setFrustum (vec4 val)
 Left, right, bottom, top view volume. More...
 
const vec2 & getFrustumOffset () const
 
void setFrustumOffset (vec2 val)
 Left, right, bottom, top view volume. More...
 
virtual float getAspectRatio () const override
 
virtual void setAspectRatio (float val) override
 
virtual void serialize (Serializer &s) const override
 
virtual void deserialize (Deserializer &d) override
 
- Public Member Functions inherited from inviwo::Camera
 Camera (vec3 lookFrom=vec3(0.0f, 0.0f, 2.0f), vec3 lookTo=vec3(0.0f), vec3 lookUp=vec3(0.0f, 1.0f, 0.0f), float nearPlane=0.01f, float farPlane=10000.0f)
 Default parameters creates a right handed coordinate system with camera looking towards the negative z-axis. with X = (1, 0, 0), Y = (0, 1, 0), Z = (0, 0, -1) More...
 
 Camera (const Camera &other)=default
 
Cameraoperator= (const Camera &other)=default
 
const vec3 & getLookFrom () const
 
void setLookFrom (vec3 val)
 
const vec3 & getLookTo () const
 
void setLookTo (vec3 val)
 
const vec3 & getLookUp () const
 
void setLookUp (vec3 val)
 
vec3 getDirection () const
 Get unnormalized direction of camera: lookTo - lookFrom.
 
void setNearPlaneDist (float distance)
 Set distance to the near plane from lookFrom.
 
float getNearPlaneDist () const
 
void setFarPlaneDist (float distance)
 Set distance to the far plane from lookFrom.
 
float getFarPlaneDist () const
 
const mat4 & getViewMatrix () const
 
const mat4 & getProjectionMatrix () const
 
const mat4 & getInverseViewMatrix () const
 
const mat4 & getInverseProjectionMatrix () const
 
vec3 getWorldPosFromNormalizedDeviceCoords (const vec3 &ndcCoords) const
 Convert from normalized device coordinates (xyz in [-1 1]) to world coordinates. More...
 
vec4 getClipPosFromNormalizedDeviceCoords (const vec3 &ndcCoords) const
 Convert from normalized device coordinates (xyz in [-1 1]) to clip coordinates, where z value of -1 correspond to the near plane and 1 to the far plane. Coordinates outside of the [-1 1]^3 range will be clipped. More...
 
vec3 getNormalizedDeviceFromNormalizedScreenAtFocusPointDepth (const vec2 &normalizedScreenCoord) const
 

Protected Member Functions

virtual mat4 calculateProjectionMatrix () const override
 Calculate and return the projection matrix for the camera. More...
 
- Protected Member Functions inherited from inviwo::Camera
bool equalTo (const Camera &other) const
 
void invalidateViewMatrix ()
 
void invalidateProjectionMatrix ()
 

Protected Attributes

vec4 frustum_
 
vec2 frustumSkewOffset_
 
std::shared_ptr< std::function< void()> > widthCallbackHolder_
 
std::shared_ptr< std::function< void()> > offsetCallbackHolder_
 
- Protected Attributes inherited from inviwo::Camera
vec3 lookFrom_
 
vec3 lookTo_
 
vec3 lookUp_
 
float nearPlaneDist_
 Distance to the near plane from lookFrom.
 
float farPlaneDist_
 Distance to the far plane from lookFrom.
 
bool invalidViewMatrix_
 
bool invalidProjectionMatrix_
 
mat4 viewMatrix_
 
mat4 projectionMatrix_
 
mat4 inverseViewMatrix_
 
mat4 inverseProjectionMatrix_
 

Friends

bool operator== (const SkewedPerspectiveCamera &lhs, const SkewedPerspectiveCamera &rhs)
 
bool operator!= (const SkewedPerspectiveCamera &lhs, const SkewedPerspectiveCamera &rhs)
 

Additional Inherited Members

- Public Types inherited from inviwo::Camera
enum  Config { Show, Hide }
 

Detailed Description

Camera with off axis perspective projection.

The camera with unsymmetrical frustum for stereo in VR Kooima, Robert. "Generalized perspective projection." School of Elect. Eng. and Computer Science (2008): 1-7.

See also
Camera
SkewedPerspectiveCamera

Member Function Documentation

◆ calculateProjectionMatrix()

mat4 inviwo::SkewedPerspectiveCamera::calculateProjectionMatrix ( ) const
overrideprotectedvirtual

Calculate and return the projection matrix for the camera.

Implement this function to provide your own projection computation functionality. For example orthogonal or perspective projection. This function will be called when the projection matrix is invalid.

See also
PerspectiveCamera
OrthographicCamera

Implements inviwo::Camera.

◆ setFrustum()

void inviwo::SkewedPerspectiveCamera::setFrustum ( inviwo::vec4  val)
inline

Left, right, bottom, top view volume.

Set view frustum used for projection matrix calculation.

◆ setFrustumOffset()

void inviwo::SkewedPerspectiveCamera::setFrustumOffset ( vec2  val)
inline

Left, right, bottom, top view volume.

Set view frustum used for projection matrix calculation.


The documentation for this class was generated from the following files: