|
virtual | ~VgICamera () |
|
virtual void | setPosition (const VgEngine::VgPosition &pPosition)=0 |
|
virtual void | setHeading (double pHeadingInDegrees)=0 |
|
virtual void | setPitch (double pPitchInDegrees)=0 |
|
virtual const VgEngine::VgPosition | getPosition () const =0 |
|
virtual double | getHeading () const =0 |
|
virtual double | getPitch () const =0 |
|
virtual void | setViewpoint (const VgIViewPoint &pViewpoint)=0 |
|
virtual const VgIViewPoint & | getViewpoint ()=0 |
|
virtual void | projectOnScreen (const VgEngine::VgPosition &pPosition, double &pXScreen, double &pYScreen, double *pZScreen=0) const =0 |
|
virtual bool | pickGeographicPoint (const double &pX, const double &pY, VgEngine::VgPosition &pPosition) const =0 |
|
virtual VgIViewPoint | getViewpointFromPositions (const std::vector< VgEngine::VgPosition > &pPositions, UInt pTop, UInt pBottom, UInt pLeft, UInt pRight)=0 |
|
virtual VgIViewPoint | getViewpointFromPositions (const std::vector< VgEngine::VgPosition > &pPositions, UInt pTop, UInt pBottom, UInt pLeft, UInt pRight, double pPitch, double pHeading)=0 |
|
virtual VgIViewPoint | getViewpointFromPositions (const std::vector< VgEngine::VgPosition > &pPositions, UInt pTop, UInt pBottom, UInt pLeft, UInt pRight, double pPitch, double pHeading, double pMinAltitude, double pMaxAltitude)=0 |
|
virtual double | getFovX () const =0 |
|
virtual double | getFovY () const =0 |
|
virtual void | setFovX (double pFovX, double pRatio=-1.0f)=0 |
|
This interface is used to retrieve and control the camera parameters.
Those parameters are the camera's position, heading and pitch. The position is expressed in "scene" coordinates (See VgICamera::getPosition and VgICamera::setPosition for more information). The heading is the angle with the North direction (See VgICamera::setHeading for more information). The pitch is the angle with the tangent plane (See VgICamera::setPitch for more information).
VgEngine::VgICamera::VgICamera |
( |
| ) |
|
|
inlineprotected |
virtual VgEngine::VgICamera::~VgICamera |
( |
| ) |
|
|
inlinevirtual |
virtual double VgEngine::VgICamera::getFovX |
( |
| ) |
const |
|
pure virtual |
Gets the camera's horizontal field of view.
- Returns
- The camera's horizontal field of view angle in degrees.
- Version
- 2.0
virtual double VgEngine::VgICamera::getFovY |
( |
| ) |
const |
|
pure virtual |
Gets the camera's vertical field of view.
- Returns
- The camera's vertical field of view angle in degrees.
- Version
- 2.0
virtual double VgEngine::VgICamera::getHeading |
( |
| ) |
const |
|
pure virtual |
Retrieves the current camera's heading (in degrees). 0 points north, 90 east, 180 south and 270 west. See VgICamera::setHeading for more information.
- Returns
- The heading angle in degrees in the [0, 360] interval.
virtual double VgEngine::VgICamera::getPitch |
( |
| ) |
const |
|
pure virtual |
Retrieves the current camera's pitch (in degrees). 0 is horizontal, 90 vertical upwards and -90 vertical downwards. See VgICamera::setPitch for more information.
- Returns
- The pitch angle in degrees in the [-90, 90] interval.
Retrieves the current camera's position.
- Returns
- The camera's position expressed in the scene's metric SRS.
virtual const VgIViewPoint& VgEngine::VgICamera::getViewpoint |
( |
| ) |
|
|
pure virtual |
Gets the camera viewpoint.
- Note
- The same note on positions as in VgEngine::VgICamera::getPosition applies here. Position in the returned viewpoint is in the scene's SRS.
Computes a viewpoint using the current pitch and heading, at which all given positions are visible
- Parameters
-
pPositions | List of positions to see. |
pTop | The top padding area's height to use (in pixels) |
pBottom | The bottom padding area's height to use (in pixels) |
pLeft | The left padding area's width to use (in pixels) |
pRight | The right padding area's width to use (in pixels) |
- Note
- When no position is provided (empty vector), the current viewpoint is returned.
-
When only one position is provided there is an additional constraint that forces the viewpoint to keep the current altitude. This can lead to results where the provided position would be behind the camera. For example, this will happen if the view is looking down and the point is above the camera.
-
The same notes on positions as in VgEngine::VgICamera::setPosition and VgEngine::VgICamera::getPosition apply here. The input positions will be converted to the scene's metric SRS. The computing will be done in the scene's metric SRS, and the resulting viewpoint's position expressed in it.
Computes a viewpoint using the current pitch and heading, at which all given positions are visible. This is done by computing the bounding box of all the positions, centering the center of the bounding box on the center of the screen (taking into account the padding), and moving the camera backwards from this center such that the whole bounding box is visible. If the pitch is -90, this will be tight (touching the border of the screen), otherwise it won't due to the perspective. The viewpoint position will be within the current manipulators minimum and maximum altitude boundaries. If the resulting viewpoint, is too high or too low, it will be offsetted accordingly to be inside the boundaries.
- Parameters
-
pPositions | List of positions to see. |
pTop | The top padding area's height to use (in pixels) |
pBottom | The bottom padding area's height to use (in pixels) |
pLeft | The left padding area's width to use (in pixels) |
pRight | The right padding area's width to use (in pixels) |
pPitch | The pitch to use for computation if "not-a-number" current pitch will be used. |
pHeading | The heading to use for computation if "not-a-number" current heading will be used. |
- Note
- When no position is provided (empty vector), the current viewpoint is returned.
-
When only one position is provided there is an additional constraint that forces the viewpoint to keep the current altitude. This can lead to results where the provided position would be behind the camera. For example, this will happen if the view is looking down and the point is above the camera.
-
The same notes on positions as in VgEngine::VgICamera::setPosition and VgEngine::VgICamera::getPosition apply here. The input positions will be converted to the scene's metric SRS. The computing will be done in the scene's metric SRS, and the resulting viewpoint's position expressed in it.
-
This will return a result on objects currently displayed and loaded.
- Version
- 2.1.3 updated documentation.
-
2.1.8 uses the current manipulator to make sure the returned viewpoint is within the current boundaries, especially the minimum altitude.
virtual VgIViewPoint VgEngine::VgICamera::getViewpointFromPositions |
( |
const std::vector< VgEngine::VgPosition > & |
pPositions, |
|
|
UInt |
pTop, |
|
|
UInt |
pBottom, |
|
|
UInt |
pLeft, |
|
|
UInt |
pRight, |
|
|
double |
pPitch, |
|
|
double |
pHeading, |
|
|
double |
pMinAltitude, |
|
|
double |
pMaxAltitude |
|
) |
| |
|
pure virtual |
Computes a viewpoint using the current pitch and heading, at which all given positions are visible. This is done by computing the bounding box of all the positions, centering the center of the bounding box on the center of the screen (taking into account the padding), and moving the camera backwards from this center such that the whole bounding box is visible. If the pitch is -90, this will be tight (touching the border of the screen), otherwise it won't due to the perspective. The viewpoint position will be within the current manipulators minimum and maximum altitude boundaries. If the resulting viewpoint, is too high or too low, it will be offsetted accordingly to be inside the boundaries.
- Parameters
-
pPositions | List of positions to see. |
pTop | The top padding area's height to use (in pixels) |
pBottom | The bottom padding area's height to use (in pixels) |
pLeft | The left padding area's width to use (in pixels) |
pRight | The right padding area's width to use (in pixels) |
pPitch | The pitch to use for computation if "not-a-number" current pitch will be used. |
pHeading | The heading to use for computation if "not-a-number" current heading will be used. |
pMinAltitude | The minimum altitude of the resulting viewpoint. If the best fitting is below this altitude, the viewpoint will be moved back. |
pMaxAltitude | The maximum altitude of the resulting viewpoint. If the best fitting is above this altitude, the viewpoint will be moved forward, and the view will not be best fitting. |
- Note
- When no position is provided (empty vector), the current viewpoint is returned.
-
When only one position is provided there is an additional constraint that forces the viewpoint to keep the current altitude. This can lead to results where the provided position would be behind the camera. For example, this will happen if the view is looking down and the point is above the camera.
-
The same notes on positions as in VgEngine::VgICamera::setPosition and VgEngine::VgICamera::getPosition apply here. The input positions will be converted to the scene's metric SRS. The computing will be done in the scene's metric SRS, and the resulting viewpoint's position expressed in it.
-
This will return a result on objects currently displayed and loaded.
- Version
- 2.1.8 option to limit minimum and maximum altitude of the resulting viewpoint.
virtual bool VgEngine::VgICamera::pickGeographicPoint |
( |
const double & |
pX, |
|
|
const double & |
pY, |
|
|
VgEngine::VgPosition & |
pPosition |
|
) |
| const |
|
pure virtual |
Casts a ray from a point on the screen in the 3D scene.
- Parameters
-
pX | the normalized X screen coordinate (0 is on the left of the screen, 1 on the right). |
pY | the normalized Y screen coordinate (0 is on the bottom of the screen, 1 on the top). |
pPosition | the geographic position if an intersection has been found. Expressed in the scene's SRS |
- Returns
- true if there is an intersection, false otherwise.
virtual void VgEngine::VgICamera::projectOnScreen |
( |
const VgEngine::VgPosition & |
pPosition, |
|
|
double & |
pXScreen, |
|
|
double & |
pYScreen, |
|
|
double * |
pZScreen = 0 |
|
) |
| const |
|
pure virtual |
Projects a geographic position on the screen.
- Parameters
-
pPosition | the geographic position to be projected on the screen. |
pXScreen | the projected X coordinate on the screen. This value is normalized between 0 and 1, where 0 is on the left of the screen |
pYScreen | the projected Y coordinate on the screen. This value is normalized between 0 and 1, where 0 is on the bottom of the screen. |
pZScreen | the projected Z coordinate on the screen. If the projected point is in the view frustum the value is between 0 and 1. You can use this to determine if a point is in front (smaller pZScreen) than another if pZScreen is positive. |
- Note
- The values of pXScreen, pYScreen will only be between 0 and 1 if the geographic position is visible on the screen and pZScreen is between 0 and 1.
-
The same note on positions as in VgEngine::VgICamera::setPosition applies here.
-
When pZScreen is negative there can be some instability for the values of pXScreen and pYScreen.
- Version
- 2.1.2 Updated documentation.
virtual void VgEngine::VgICamera::setFovX |
( |
double |
pFovX, |
|
|
double |
pRatio = -1.0f |
|
) |
| |
|
pure virtual |
Sets the camera's field of view. The VisioMove policy for the field of view is adaptative, this means that the engine will try to always have the same "amount of view" per pixel. As a result, when the size of the rendering surface changes, the field of view changes in order to keep a constant pixel ratio.
- Parameters
-
pFovX | The new field of view angle in degrees, valid range is [1, 179]. If outside this range, then parameter will be clamped to a reasonable value. |
pRatio | Currently, this parameter is not used. It serves as a place holder for future development. |
- Version
- 2.0.8744
virtual void VgEngine::VgICamera::setHeading |
( |
double |
pHeadingInDegrees | ) |
|
|
pure virtual |
Sets the camera's heading (0 for north, increasing value start to east).
- Parameters
-
pHeadingInDegrees | Heading angle, expressed in degrees. |
virtual void VgEngine::VgICamera::setPitch |
( |
double |
pPitchInDegrees | ) |
|
|
pure virtual |
Sets the camera's pitch. 0 to look "forward" (at the horizon), -85 to look down and +85 to towards the zenith.
- Parameters
-
pPitchInDegrees | Pitch angle, expressed in degrees. |
Sets the camera's position.
- Parameters
-
pPosition | The position where the camera must be placed. |
- Note
- Since verion 2.0, the positions can now be expressed in various spatial reference systems. As a camera can only exist in "scene" coordinates, the provided position will be converted to the scene's spatial reference system. see VgEngine::VgPosition and VgEngine::VgSRS for more details.
virtual void VgEngine::VgICamera::setViewpoint |
( |
const VgIViewPoint & |
pViewpoint | ) |
|
|
pure virtual |
The documentation for this interface was generated from the following file: