Constructor
new FirstPersonCamera(wwd)
Constructs a first person camera.
Parameters:
Name | Type | Description |
---|---|---|
wwd |
WorldWindow | The WorldWindow instance. |
- Source:
Throws:
-
If the WorldWindow instance is missing.
- Type
- ArgumentError
Members
heading :Number
The heading of the camera, between -180 to +180 degrees.
It is used for looking left or right.
Type:
- Number
- Default Value:
- 0
- Source:
position :Position
The position of the camera
Type:
- Source:
range :Number
The altitude of the camera.
Type:
- Number
- Default Value:
- 1000 meters
- Source:
roll :Number
This camera's roll, in degrees.
Type:
- Number
- Default Value:
- 0
- Source:
tilt :Number
The tilt of the camera, between -90 to +90 degrees.
It is for looking up or down.
Type:
- Number
- Default Value:
- 0
- Source:
wwd :WorldWindow
The WorldWindow instance
Type:
- Source:
Methods
applyLimits()
Enforces navigation limits for this camera:
- a valid position: latitude -90 to 90 deg, longitude -180 to 180 deg, altitude, 0 to Number.MAX_VALUE
- a valid heading angle: -180 to +180 deg
- a valid tilt angle: -90 to 90 deg
- a valid roll angle: -180 to +180 deg
- Source:
clone(camera) → {FirstPersonCamera}
Clones this camera to the specified camera.
If a camera is not provied a new one will be created.
Parameters:
Name | Type | Description |
---|---|---|
camera |
FirstPersonCamera | undefined | The camera to save the rsults in. |
- Source:
Returns:
A colne of this camera.
- Type
- FirstPersonCamera
copy(camera) → {FirstPersonCamera}
Copies this camera to the specified camera.
Parameters:
Name | Type | Description |
---|---|---|
camera |
FirstPersonCamera | The camera to copy. |
- Source:
Throws:
-
If the specified camera is missing.
- Type
- ArgumentError
Returns:
This camera, set to the values of the specified camera.
- Type
- FirstPersonCamera
createViewMatrix(matrix) → {Matrix}
Creates a view matrix for this camera.
Parameters:
Name | Type | Description |
---|---|---|
matrix |
Matrix | A matrix in which to set the view matrix. |
- Source:
Throws:
-
If the specified matrix is missing.
- Type
- ArgumentError
Returns:
The view matrix.
- Type
- Matrix
toArcBall(arcBallCamera) → {ArcBallCamera}
Converts this camera to an ArcBallCamera.
The resulting lookAt position is computed from the range of the specified ArcBallCamera.
Parameters:
Name | Type | Description |
---|---|---|
arcBallCamera |
ArcBallCamera | An arcBallCamera instance in which to save the result of the transformation. |
- Source:
Throws:
-
If the specified arcBallCamera is missing.
- Type
- ArgumentError
Returns:
The specified arcBallCamera.
- Type
- ArcBallCamera