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

#include <inviwo/sgct/datastructures/sgctcamera.h>

Inheritance diagram for inviwo::SGCTCamera:

Public Member Functions

virtual SGCTCamera * clone () const override
virtual void configureProperties (CameraProperty &cameraProperty, bool attach) override
virtual void deserialize (Deserializer &d) override
virtual std::string_view getClassIdentifier () const override
float getFovy () const
SGCTCamera & operator= (const SGCTCamera &other)=default
SGCTCamera & operator= (SGCTCamera &&other) noexcept=default
virtual void serialize (Serializer &s) const override
void setExternal (const sgct::RenderData &renderData)
void setFovy (float val)
 SGCTCamera (const SGCTCamera &other)=default
 SGCTCamera (SGCTCamera &&other) noexcept=default
 SGCTCamera (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)
virtual void updateFrom (const Camera &source) override
virtual void zoom (const ZoomOptions &opts) override
Public Member Functions inherited from inviwo::Camera
 Camera (Camera &&other) noexcept=default
 Camera (const Camera &other)=default
 Camera (vec3 lookFrom, vec3 lookTo, vec3 lookUp, float nearPlane, float farPlane, float aspectRatio)
 Create a camera.
virtual float getAspectRatio () const
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 getDirection () const
 Get unnormalized direction of camera: lookTo - lookFrom.
float getFarPlaneDist () const
const mat4 & getInverseProjectionMatrix () const
const mat4 & getInverseViewMatrix () const
const vec3 & getLookFrom () const
const vec3 & getLookTo () const
const vec3 & getLookUp () const
float getNearPlaneDist () const
vec3 getNormalizedDeviceFromNormalizedScreenAtFocusPointDepth (const vec2 &normalizedScreenCoord) const
const mat4 & getProjectionMatrix () const
const mat4 & getViewMatrix () const
vec3 getWorldPosFromNormalizedDeviceCoords (const vec3 &ndcCoords) const
 Convert from normalized device coordinates (xyz in [-1 1]) to world coordinates.
Cameraoperator= (Camera &&other) noexcept=default
Cameraoperator= (const Camera &other)=default
virtual void setAspectRatio (float val)
virtual void setFarPlaneDist (float distance)
 Set distance to the far plane from lookFrom.
void setLook (vec3 lookFrom, vec3 lookTo, vec3 lookUp)
virtual void setLookFrom (vec3 val)
virtual void setLookTo (vec3 val)
virtual void setLookUp (vec3 val)
virtual void setNearPlaneDist (float distance)
 Set distance to the near plane from lookFrom.

Static Public Attributes

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

Protected Member Functions

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

Protected Attributes

mat4 extModel_ {1.0f}
std::optional< mat4 > extProj_ {}
mat4 extView_ {1.0f}
float fovy_
Protected Attributes inherited from inviwo::Camera
float aspectRatio_
CameraPropertycamprop_ = nullptr
float farPlaneDist_
 Distance to the far plane from lookFrom.
bool invalidProjectionMatrix_
bool invalidViewMatrix_
mat4 inverseProjectionMatrix_
mat4 inverseViewMatrix_
vec3 lookFrom_
vec3 lookTo_
vec3 lookUp_
float nearPlaneDist_
 Distance to the near plane from lookFrom.
mat4 projectionMatrix_
mat4 viewMatrix_

Detailed Description

A Perspective Camera with the possibility of injecting additional external model, view, and projection matrices.

Member Function Documentation

◆ calculateProjectionMatrix()

virtual mat4 inviwo::SGCTCamera::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::SGCTCamera::calculateViewMatrix ( ) const
overrideprotectedvirtual

Reimplemented from inviwo::Camera.

◆ clone()

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

Implements inviwo::Camera.

◆ configureProperties()

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

Reimplemented from inviwo::Camera.

◆ deserialize()

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

Reimplemented from inviwo::Camera.

◆ equal()

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

Implements inviwo::Camera.

◆ getClassIdentifier()

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

Implements inviwo::Camera.

◆ serialize()

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

Reimplemented from inviwo::Camera.

◆ updateFrom()

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

Reimplemented from inviwo::Camera.

◆ zoom()

virtual void inviwo::SGCTCamera::zoom ( const ZoomOptions & opts)
overridevirtual

Implements inviwo::Camera.


The documentation for this class was generated from the following file:
  • modules/sgct/include/inviwo/sgct/datastructures/sgctcamera.h