Point Cloud Viewer
1.00
A Viewer to display point clouds with phong shading by converting them to splats.
|
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. | |
This class provides camera functionality.
The rotation is free in yaw and pitch. The roll is fixed.
Camera::Camera | ( | ) |
Creates a new camera.
The camera is located at (1,0,0) with perspective activated. It points toward the origin.
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!
aspect | The aspect ratio of the image plane (x/y) |
yWidth | The height of the image plane. |
zNear | The z value of the near plane. |
zFar | The 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.
aspect | The aspect ratio of the image plane (x/y) |
fovy | The vertical field of view - e.g. 90 results in 45° up and 45° down. |
zNear | The z value of the near plane. |
zFar | The 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.
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.
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.
up | The y coordinate in view space. |
right | The x coordinate in view space. |
up | - 2D move from mouse, up/down |
right | - 2D move from mouse, right/left |
QVector3D Camera::getViewTarget | ( | ) |
Returns the location of the camera's view target.
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.
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.
void Camera::move | ( | float | up, |
float | right | ||
) |
Moves the camera.
The camera will be moved together with its view target resulting in no rotation.
up | The amount of movement along the y camera-axis given in an abstract unit. |
right | The 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.
deg_x | The angle of rotation around the y world-axis direction. |
deg_y | The angle of rotation around the x camera-axis direction. |
|
overridevirtual |
|
overridevirtual |
Changes the entity's location.
x | The new x coordinate. |
y | The new y coordinate. |
z | The 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.
target | The target location. |