public class VgICamera
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
void |
delete() |
double |
getFovX()
Gets the camera's horizontal field of view.
|
double |
getFovY()
Gets the camera's vertical field of view.
|
double |
getHeading()
Retrieves the current camera's heading (in degrees).
0 points north, 90 east, 180 south and 270 west.
|
double |
getPitch()
Retrieves the current camera's pitch (in degrees).
0 is horizontal, 90 vertical upwards and -90 vertical downwards.
|
VgPosition |
getPosition()
Retrieves the current camera's position.
|
VgIViewPoint |
getViewpoint()
Gets the camera viewpoint.
|
VgIViewPoint |
getViewpointFromPositions(VgPositionVector pPositions,
long pTop,
long pBottom,
long pLeft,
long pRight)
Computes a viewpoint using the current pitch and heading, at which all given positions are visible
|
VgIViewPoint |
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
|
boolean |
pickGeographicPoint(double pX,
double pY,
VgPosition pPosition)
Casts a ray from a point on the screen in the 3D scene.
|
void |
projectOnScreen(VgPosition pPosition,
double[] pXScreen,
double[] pYScreen) |
void |
projectOnScreen(VgPosition pPosition,
double[] pXScreen,
double[] pYScreen,
double[] pZScreen)
Projects a position on the screen.
|
void |
setFovX(double pFovX) |
void |
setFovX(double pFovX,
double pRatio)
Sets the camera's field of view.
|
void |
setHeading(double pHeadingInDegrees)
Sets the camera's heading (0 for north, increasing value start to east).
|
void |
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.
|
void |
setPosition(VgPosition pPosition)
Sets the camera's position.
|
void |
setViewpoint(VgIViewPoint pViewpoint)
Sets the camera viewpoint.
|
public void delete()
public void setPosition(VgPosition pPosition)
pPosition
- The position where the camera must be placed.public void setHeading(double pHeadingInDegrees)
pHeadingInDegrees
- Heading angle, expressed in degrees.public void setPitch(double pPitchInDegrees)
pPitchInDegrees
- Pitch angle, expressed in degrees.public VgPosition getPosition()
public double getHeading()
public double getPitch()
public void setViewpoint(VgIViewPoint pViewpoint)
pViewpoint
- The viewpoint to set.public VgIViewPoint getViewpoint()
public void projectOnScreen(VgPosition pPosition, double[] pXScreen, double[] pYScreen, double[] pZScreen)
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 screenpYScreen
- 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.public void projectOnScreen(VgPosition pPosition, double[] pXScreen, double[] pYScreen)
public boolean pickGeographicPoint(double pX, double pY, VgPosition pPosition)
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 SRSpublic VgIViewPoint getViewpointFromPositions(VgPositionVector pPositions, long pTop, long pBottom, long pLeft, long pRight, double pPitch, double pHeading)
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 pitch to use for computation if "not-a-number" current heading will be used.public VgIViewPoint getViewpointFromPositions(VgPositionVector pPositions, long pTop, long pBottom, long pLeft, long pRight)
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)public double getFovX()
public double getFovY()
public void setFovX(double pFovX, double pRatio)
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.public void setFovX(double pFovX)