Point Cloud Viewer  1.00
A Viewer to display point clouds with phong shading by converting them to splats.
Camera Class Reference

This class provides camera functionality. More...

#include <camera.h>

Inherits Entity.

Public Member Functions

 Camera ()
 Creates a new camera. More...
 
void activatePerspective (float aspect=1.0f, float fovy=90.0f, float zNear=0.1f, float zFar=100.0f)
 Switches the camera into perspective mode. More...
 
void activateOrthographic (float aspect=1.0f, float yWidth=2.0f, float zNear=0.1f, float zFar=100.0f)
 Switches the camera into orthographic mode. NOT SUPPORTED! More...
 
void setPos (QVector3D &pos) override
 Changes the entity's location. More...
 
void setPos (float x, float y, float z) override
 Changes the entity's location. More...
 
void setTarget (QVector3D &target)
 Changes the view target location. More...
 
QMatrix4x4 & getVpMat ()
 Returns a link to the view projection matrix. More...
 
QMatrix4x4 & getVMat ()
 Returns a link to the view matrix. More...
 
QMatrix4x4 & getInvProjMat ()
 Returns a link to the inverse projection matrix. More...
 
void rotate (float deg_x, float deg_y)
 Rotates the camera. More...
 
void move (float up, float right)
 Moves the camera. More...
 
float & getPointSizeCoeff ()
 Returns a pointer to the pointSizeCoeff. More...
 
QVector3D getViewDependentMoveVector (float up, float right)
 Transforms a vector from view space to world space. More...
 
QVector3D getViewTarget ()
 Returns the location of the camera's view target. More...
 
- Public Member Functions inherited from Entity
 Entity (float x, float y, float z)
 Creates a new entity at the given location. More...
 
 Entity ()
 Creates a new entity at the origin (0,0,0).
 
float distance (Entity &to)
 Computes the euclidean distance to another entity. More...
 
float distance (float x, float y, float z)
 Computes the euclidean distance to a location. More...
 
QVector3D getPos ()
 Returns the location of the entity. More...
 

Additional Inherited Members

- Public Attributes inherited from Entity
float x
 The x coordinate of the entity's location.
 
float y
 The y coordinate of the entity's location.
 
float z
 The z coordinate of the entity's location.
 

Detailed Description

This class provides camera functionality.

The rotation is free in yaw and pitch. The roll is fixed.

Constructor & Destructor Documentation

Camera::Camera ( )

Creates a new camera.

The camera is located at (1,0,0) with perspective activated. It points toward the origin.

Member Function Documentation

void Camera::activateOrthographic ( float  aspect = 1.0f,
float  yWidth = 2.0f,
float  zNear = 0.1f,
float  zFar = 100.0f 
)

Switches the camera into orthographic mode. NOT SUPPORTED!

Parameters
aspectThe aspect ratio of the image plane (x/y)
yWidthThe height of the image plane.
zNearThe z value of the near plane.
zFarThe z value of the far plane.
void Camera::activatePerspective ( float  aspect = 1.0f,
float  fovy = 90.0f,
float  zNear = 0.1f,
float  zFar = 100.0f 
)

Switches the camera into perspective mode.

Parameters
aspectThe aspect ratio of the image plane (x/y)
fovyThe vertical field of view - e.g. 90 results in 45° up and 45° down.
zNearThe z value of the near plane.
zFarThe z value of the far plane.
QMatrix4x4 & Camera::getInvProjMat ( )

Returns a link to the inverse projection matrix.

The matrix link will stay valid while the camera exists and is kept up-to-date.

Returns
The inverse projection matrix.
float & Camera::getPointSizeCoeff ( )

Returns a pointer to the pointSizeCoeff.

This value is needed for the visibility and the attribute pass to compute the Splat-BoundingBoxes. This link will stay valid while the camera exists and is kept up-to-date.

Returns
The pointSizeCoeff.
QVector3D Camera::getViewDependentMoveVector ( float  up,
float  right 
)

Transforms a vector from view space to world space.

Camera::getViewDependentMoveVector.

The x and y coordinates can be defined, the z coordinate is assumed 0.

Parameters
upThe y coordinate in view space.
rightThe x coordinate in view space.
Returns
The vector in world space.
Parameters
up- 2D move from mouse, up/down
right- 2D move from mouse, right/left
Returns
3D vector to move object depending on current view
QVector3D Camera::getViewTarget ( )

Returns the location of the camera's view target.

Returns
The target location.
QMatrix4x4 & Camera::getVMat ( )

Returns a link to the view matrix.

The matrix link will stay valid while the camera exists and is kept up-to-date.

Returns
The v-Matrix.
QMatrix4x4 & Camera::getVpMat ( )

Returns a link to the view projection matrix.

The matrix link will stay valid while the camera exists and is kept up-to-date.

Returns
The vp-Matrix.
void Camera::move ( float  up,
float  right 
)

Moves the camera.

The camera will be moved together with its view target resulting in no rotation.

Parameters
upThe amount of movement along the y camera-axis given in an abstract unit.
rightThe amount of movement along the x camera-axis given in an abstract unit.
void Camera::rotate ( float  deg_x,
float  deg_y 
)

Rotates the camera.

The camera will be rotated around the view target location while staying focused onto the target.

Parameters
deg_xThe angle of rotation around the y world-axis direction.
deg_yThe angle of rotation around the x camera-axis direction.
void Camera::setPos ( QVector3D &  pos)
overridevirtual

Changes the entity's location.

Parameters
posThe new position.

Reimplemented from Entity.

void Camera::setPos ( float  x,
float  y,
float  z 
)
overridevirtual

Changes the entity's location.

Parameters
xThe new x coordinate.
yThe new y coordinate.
zThe new z coordinate.

Reimplemented from Entity.

void Camera::setTarget ( QVector3D &  target)

Changes the view target location.

The rotation of the camera will be adjusted so that the target will project to the center of the image plane.

Parameters
targetThe target location.

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