SPH
|
Perspective camera. More...
#include <Camera.h>
Public Member Functions | |
PerspectiveCamera (const CameraParams &data) | |
virtual void | autoSetup (const Storage &storage) override |
Initializes the camera, using the provided particle storage. More... | |
virtual Optional< ProjectedPoint > | project (const Vector &r) const override |
Returns projected position of particle on the image. More... | |
virtual Optional< CameraRay > | unproject (const Coords &coords) const override |
Returns a ray in particle coordinates corresponding to given coordinates in the image plane. More... | |
virtual Pixel | getSize () const override |
Returns the current resolution of the camera. More... | |
virtual AffineMatrix | getFrame () const override |
Returns the transformation matrix converting camera space to world space. More... | |
virtual Vector | getTarget () const override |
Returns the current target point of the camera. More... | |
virtual Vector | getUpVector () const override |
Returns the reference "up" direction of the camera. More... | |
virtual Optional< float > | getCutoff () const override |
Returns the clipping distance from plane passing through origin, perpendicular to camera direction. More... | |
virtual Optional< float > | getWorldToPixel () const override |
Returns the world-to-pixel ratio. More... | |
virtual void | setCutoff (const Optional< float > newCutoff) override |
Modifies the clipping distance of the camera. More... | |
virtual void | zoom (const Pixel UNUSED(fixedPoint), const float magnitude) override |
virtual void | setPosition (const Vector &newPosition) override |
Moves the camera to new position in world space. More... | |
virtual void | setTarget (const Vector &newTarget) override |
virtual void | transform (const AffineMatrix &matrix) override |
Transforms the current view by given matrix. More... | |
virtual void | pan (const Pixel offset) override |
Moves the camera by relative offset in image space. More... | |
virtual void | resize (const Pixel newSize) override |
Changes the image size. More... | |
virtual AutoPtr< ICamera > | clone () const override |
![]() | |
virtual void | zoom (const Pixel fixedPoint, const float magnitude)=0 |
![]() | |
virtual | ~Polymorphic () |
PerspectiveCamera::PerspectiveCamera | ( | const CameraParams & | data | ) |
Definition at line 219 of file Camera.cpp.
|
overridevirtual |
Initializes the camera, using the provided particle storage.
Implements ICamera.
Definition at line 226 of file Camera.cpp.
|
overridevirtual |
Returns the clipping distance from plane passing through origin, perpendicular to camera direction.
If no clipping is used, the function returns NOTHING. Useful to view a section through a body rather than its surface.
Implements ICamera.
Definition at line 289 of file Camera.cpp.
|
overridevirtual |
Returns the transformation matrix converting camera space to world space.
In the camera space, camera direction is aligned with the z-axis, y-axis corresponds to the up-vector and x-axis is perpendicular, i.e. left-vector.
Implements ICamera.
Definition at line 279 of file Camera.cpp.
|
overridevirtual |
Returns the current resolution of the camera.
Implements ICamera.
Definition at line 275 of file Camera.cpp.
|
overridevirtual |
Returns the current target point of the camera.
Implements ICamera.
Definition at line 285 of file Camera.cpp.
|
overridevirtual |
Returns the reference "up" direction of the camera.
Implements ICamera.
Definition at line 316 of file Camera.cpp.
|
overridevirtual |
|
overridevirtual |
Moves the camera by relative offset in image space.
Implements ICamera.
Definition at line 329 of file Camera.cpp.
|
overridevirtual |
Returns projected position of particle on the image.
If the particle is outside of the image region or is clipped by the projection, returns NOTHING.
Implements ICamera.
Definition at line 239 of file Camera.cpp.
|
overridevirtual |
|
overridevirtual |
Modifies the clipping distance of the camera.
The clipping can be disabled by passing NOTHING.
Implements ICamera.
Definition at line 298 of file Camera.cpp.
|
overridevirtual |
Moves the camera to new position in world space.
Implements ICamera.
Definition at line 306 of file Camera.cpp.
|
overridevirtual |
Implements ICamera.
Definition at line 311 of file Camera.cpp.
|
overridevirtual |
Transforms the current view by given matrix.
This replaces previous transformation matrix, i.e. subsequent calls do not accumulate.
matrix | Transform matrix applied to the camera. |
Implements ICamera.
Definition at line 320 of file Camera.cpp.
Returns a ray in particle coordinates corresponding to given coordinates in the image plane.
Implements ICamera.
Definition at line 264 of file Camera.cpp.
|
overridevirtual |
Definition at line 300 of file Camera.cpp.
Vector PerspectiveCamera::dir |
Vector PerspectiveCamera::left |
Vector PerspectiveCamera::up |