Inviwo 0.9.12-pre
Inviwo documentation
Loading...
Searching...
No Matches
inviwo::SkewedPerspectiveCamera Class Referencefinal

Camera with off axis perspective projection. More...

#include <skewedperspectivecamera.h>

+ Inheritance diagram for inviwo::SkewedPerspectiveCamera:

Public Member Functions

 SkewedPerspectiveCamera (vec3 lookFrom=cameradefaults::lookFrom, vec3 lookTo=cameradefaults::lookTo, vec3 lookUp=cameradefaults::lookUp, float nearPlane=cameradefaults::nearPlane, float farPlane=cameradefaults::farPlane, float aspectRatio=cameradefaults::aspectRatio, float fieldOfView=cameradefaults::fieldOfView, vec2 frustumOffset=vec2(0.0f, 0.0f))
 
 SkewedPerspectiveCamera (const SkewedPerspectiveCamera &other)
 
SkewedPerspectiveCameraoperator= (const SkewedPerspectiveCamera &other)
 
virtual SkewedPerspectiveCameraclone () const override
 
virtual std::string_view getClassIdentifier () const override
 
virtual void updateFrom (const Camera &source) override
 
virtual void configureProperties (CameraProperty &cameraProperty, bool attach) override
 
float getFovy () const
 
void setFovy (float val)
 
const vec2 & getOffset () const
 
void setOffset (vec2 val)
 
virtual void zoom (float factor, std::optional< mat4 > boundingBox) override
 
virtual void setLookFrom (vec3 val) override
 
virtual void setLookTo (vec3 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 lookTo, vec3 lookUp, float nearPlane, float farPlane, float aspectRatio)
 Create a camera.
 
 Camera (const Camera &other)=default
 
Cameraoperator= (const Camera &other)=default
 
 Camera (Camera &&other) noexcept=default
 
Cameraoperator= (Camera &&other) noexcept=default
 
const vec3 & getLookFrom () const
 
const vec3 & getLookTo () const
 
const vec3 & getLookUp () const
 
virtual void setLookUp (vec3 val)
 
virtual float getAspectRatio () const
 
virtual void setAspectRatio (float val)
 
vec3 getDirection () const
 Get unnormalized direction of camera: lookTo - lookFrom.
 
virtual void setNearPlaneDist (float distance)
 Set distance to the near plane from lookFrom.
 
float getNearPlaneDist () const
 
virtual 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.
 
virtual 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.
 
vec3 getNormalizedDeviceFromNormalizedScreenAtFocusPointDepth (const vec2 &normalizedScreenCoord) const
 
- Public Member Functions inherited from inviwo::Serializable

Static Public Attributes

static constexpr std::string_view classIdentifier {"SkewedPerspectiveCamera"}
 

Protected Member Functions

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

Protected Attributes

float fovy_
 
vec2 offset_
 
- 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.
 
float aspectRatio_
 
bool invalidViewMatrix_
 
bool invalidProjectionMatrix_
 
mat4 viewMatrix_
 
mat4 projectionMatrix_
 
mat4 inverseViewMatrix_
 
mat4 inverseProjectionMatrix_
 
CameraPropertycamprop_ = nullptr
 

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

Member Function Documentation

◆ calculateProjectionMatrix()

virtual 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.

◆ calculateViewMatrix()

virtual mat4 inviwo::SkewedPerspectiveCamera::calculateViewMatrix ( ) const
overrideprotectedvirtual

Reimplemented from inviwo::Camera.

◆ clone()

virtual SkewedPerspectiveCamera * inviwo::SkewedPerspectiveCamera::clone ( ) const
overridevirtual

Implements inviwo::Camera.

◆ configureProperties()

virtual void inviwo::SkewedPerspectiveCamera::configureProperties ( CameraProperty & cameraProperty,
bool attach )
overridevirtual

Reimplemented from inviwo::Camera.

◆ deserialize()

virtual void inviwo::SkewedPerspectiveCamera::deserialize ( Deserializer & d)
overridevirtual

Reimplemented from inviwo::Camera.

◆ equal()

virtual bool inviwo::SkewedPerspectiveCamera::equal ( const Camera & other) const
overrideprotectedvirtual

Implements inviwo::Camera.

◆ getClassIdentifier()

virtual std::string_view inviwo::SkewedPerspectiveCamera::getClassIdentifier ( ) const
overridevirtual

Implements inviwo::Camera.

◆ serialize()

virtual void inviwo::SkewedPerspectiveCamera::serialize ( Serializer & s) const
overridevirtual

Reimplemented from inviwo::Camera.

◆ setLookFrom()

virtual void inviwo::SkewedPerspectiveCamera::setLookFrom ( vec3 val)
overridevirtual

Reimplemented from inviwo::Camera.

◆ setLookTo()

virtual void inviwo::SkewedPerspectiveCamera::setLookTo ( vec3 val)
overridevirtual

Reimplemented from inviwo::Camera.

◆ updateFrom()

virtual void inviwo::SkewedPerspectiveCamera::updateFrom ( const Camera & source)
overridevirtual

Reimplemented from inviwo::Camera.

◆ zoom()

virtual void inviwo::SkewedPerspectiveCamera::zoom ( float factor,
std::optional< mat4 > boundingBox )
overridevirtual

Implements inviwo::Camera.


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