SPH
|
Interface defining a camera or view, used by a renderer. More...
#include <Camera.h>
Public Member Functions | |
virtual void | autoSetup (const Storage &storage)=0 |
Initializes the camera, using the provided particle storage. More... | |
virtual Optional< ProjectedPoint > | project (const Vector &r) const =0 |
Returns projected position of particle on the image. More... | |
virtual Optional< CameraRay > | unproject (const Coords &coords) const =0 |
Returns a ray in particle coordinates corresponding to given coordinates in the image plane. More... | |
virtual Pixel | getSize () const =0 |
Returns the current resolution of the camera. More... | |
virtual AffineMatrix | getFrame () const =0 |
Returns the transformation matrix converting camera space to world space. More... | |
virtual Vector | getTarget () const =0 |
Returns the current target point of the camera. More... | |
virtual Vector | getUpVector () const =0 |
Returns the reference "up" direction of the camera. More... | |
virtual Optional< float > | getCutoff () const =0 |
Returns the clipping distance from plane passing through origin, perpendicular to camera direction. More... | |
virtual Optional< float > | getWorldToPixel () const =0 |
Returns the world-to-pixel ratio. More... | |
virtual void | setCutoff (const Optional< float > newCutoff)=0 |
Modifies the clipping distance of the camera. More... | |
virtual void | zoom (const Pixel fixedPoint, const float magnitude)=0 |
virtual void | setPosition (const Vector &newPosition)=0 |
Moves the camera to new position in world space. More... | |
virtual void | setTarget (const Vector &newTarget)=0 |
virtual void | transform (const AffineMatrix &matrix)=0 |
Transforms the current view by given matrix. More... | |
virtual void | pan (const Pixel offset)=0 |
Moves the camera by relative offset in image space. More... | |
virtual void | resize (const Pixel newSize)=0 |
Changes the image size. More... | |
virtual AutoPtr< ICamera > | clone () const =0 |
![]() | |
virtual | ~Polymorphic () |
|
pure virtual |
Initializes the camera, using the provided particle storage.
Implemented in PanoCameraBase, PerspectiveCamera, and OrthoCamera.
Implemented in SphericalCamera, FisheyeCamera, PerspectiveCamera, and OrthoCamera.
|
pure virtual |
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.
Implemented in PanoCameraBase, PerspectiveCamera, and OrthoCamera.
|
pure virtual |
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.
Implemented in PanoCameraBase, PerspectiveCamera, and OrthoCamera.
|
pure virtual |
Returns the current resolution of the camera.
Implemented in PanoCameraBase, PerspectiveCamera, and OrthoCamera.
|
pure virtual |
Returns the current target point of the camera.
Implemented in PanoCameraBase, PerspectiveCamera, and OrthoCamera.
|
pure virtual |
Returns the reference "up" direction of the camera.
Implemented in PanoCameraBase, PerspectiveCamera, and OrthoCamera.
|
pure virtual |
Returns the world-to-pixel ratio.
Implemented in PanoCameraBase, PerspectiveCamera, and OrthoCamera.
|
pure virtual |
Moves the camera by relative offset in image space.
Implemented in PanoCameraBase, PerspectiveCamera, and OrthoCamera.
|
pure virtual |
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.
Implemented in PanoCameraBase, PerspectiveCamera, and OrthoCamera.
|
pure virtual |
Changes the image size.
Implemented in PanoCameraBase, PerspectiveCamera, and OrthoCamera.
|
pure virtual |
Modifies the clipping distance of the camera.
The clipping can be disabled by passing NOTHING.
Implemented in PanoCameraBase, PerspectiveCamera, and OrthoCamera.
|
pure virtual |
Moves the camera to new position in world space.
Implemented in PanoCameraBase, PerspectiveCamera, and OrthoCamera.
|
pure virtual |
Implemented in PanoCameraBase, PerspectiveCamera, and OrthoCamera.
|
pure virtual |
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. |
Implemented in PanoCameraBase, PerspectiveCamera, and OrthoCamera.
Returns a ray in particle coordinates corresponding to given coordinates in the image plane.
Implemented in SphericalCamera, FisheyeCamera, PerspectiveCamera, and OrthoCamera.
|
pure virtual |
Applies | zoom to the camera. |
This is usually equivalent to transforming the view with scaling matrix, alhough it can be implemented differently.
fixedPoint | Point that remains fixed after the zoom (for magnitude != 1, there is exactly one) |
magnitude | Relative zoom amount, value <1 means zooming out, value >1 means zooming in. |
Implemented in OrthoCamera.