|
void | setPosition (VgPosition pPosition) |
|
void | setHeading (double pHeadingInDegrees) |
|
void | setPitch (double pPitchInDegrees) |
|
VgPosition | getPosition () |
|
double | getHeading () |
|
double | getPitch () |
|
void | setViewpoint (VgIViewPoint pViewpoint) |
|
VgIViewPoint | getViewpoint () |
|
void | projectOnScreen (VgPosition pPosition, double[] pXScreen, double[] pYScreen, double[] pZScreen) |
|
void | projectOnScreen (VgPosition pPosition, double[] pXScreen, double[] pYScreen) |
|
boolean | pickGeographicPoint (double pX, double pY, VgPosition pPosition) |
|
VgIViewPoint | getViewpointFromPositions (VgPositionVector pPositions, long pTop, long pBottom, long pLeft, long pRight) |
|
VgIViewPoint | getViewpointFromPositions (VgPositionVector pPositions, long pTop, long pBottom, long pLeft, long pRight, double pPitch, double pHeading) |
|
VgIViewPoint | getViewpointFromPositions (VgPositionVector pPositions, long pTop, long pBottom, long pLeft, long pRight, double pPitch, double pHeading, double pMinAltitude, double pMaxAltitude) |
|
double | getFovX () |
|
double | getFovY () |
|
void | setFovX (double pFovX, double pRatio) |
|
void | setFovX (double pFovX) |
|
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).
double VgICamera.getFovX |
( |
| ) |
|
Gets the camera's horizontal field of view.
- Version
- 2.0
- Returns
- The camera's horizontal field of view angle in degrees.
double VgICamera.getFovY |
( |
| ) |
|
Gets the camera's vertical field of view.
- Version
- 2.0
- Returns
- The camera's vertical field of view angle in degrees.
double VgICamera.getHeading |
( |
| ) |
|
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.
double VgICamera.getPitch |
( |
| ) |
|
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.
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
- 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.
- 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) |
VgIViewPoint VgICamera.getViewpointFromPositions |
( |
VgPositionVector |
pPositions, |
|
|
long |
pTop, |
|
|
long |
pBottom, |
|
|
long |
pLeft, |
|
|
long |
pRight, |
|
|
double |
pPitch, |
|
|
double |
pHeading |
|
) |
| |
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.
- 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.
- 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. |
- 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.
VgIViewPoint VgICamera.getViewpointFromPositions |
( |
VgPositionVector |
pPositions, |
|
|
long |
pTop, |
|
|
long |
pBottom, |
|
|
long |
pLeft, |
|
|
long |
pRight, |
|
|
double |
pPitch, |
|
|
double |
pHeading, |
|
|
double |
pMinAltitude, |
|
|
double |
pMaxAltitude |
|
) |
| |
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.
- 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.
- 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. |
- Version
- 2.1.8 option to limit minimum and maximum altitude of the resulting viewpoint.
boolean VgICamera.pickGeographicPoint |
( |
double |
pX, |
|
|
double |
pY, |
|
|
VgPosition |
pPosition |
|
) |
| |
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.
void VgICamera.projectOnScreen |
( |
VgPosition |
pPosition, |
|
|
double[] |
pXScreen, |
|
|
double[] |
pYScreen, |
|
|
double[] |
pZScreen |
|
) |
| |
Projects a geographic position on the screen.
- 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.
- 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. |
- Version
- 2.1.2 Updated documentation.
void VgICamera.projectOnScreen |
( |
VgPosition |
pPosition, |
|
|
double[] |
pXScreen, |
|
|
double[] |
pYScreen |
|
) |
| |
void VgICamera.setFovX |
( |
double |
pFovX, |
|
|
double |
pRatio |
|
) |
| |
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
void VgICamera.setFovX |
( |
double |
pFovX | ) |
|
void VgICamera.setHeading |
( |
double |
pHeadingInDegrees | ) |
|
Sets the camera's heading (0 for north, increasing value start to east).
- Parameters
-
pHeadingInDegrees | Heading angle, expressed in degrees. |
void VgICamera.setPitch |
( |
double |
pPitchInDegrees | ) |
|
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. |
void VgICamera.setPosition |
( |
VgPosition |
pPosition | ) |
|
Sets the camera's position.
- 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.
- Parameters
-
pPosition | The position where the camera must be placed. |
Sets the camera viewpoint.
- Note
- The same note on positions as in VgEngine::VgICamera::setPosition applies here.
- Parameters
-
pViewpoint | The viewpoint to set. |
The documentation for this class was generated from the following file: