Constructor#
new PlanetCamera(planet, optionsopt)#
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
planet | Planet | Planet render node. | |||||||||||||||||||||||||||||||||||||||||
options | IPlanetCameraParams | <optional> | Planet camera options: Properties
|
- Source
Extends#
Methods#
_init(optionsopt)#
Camera initialization.
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options | Object | <optional> | Camera options: Properties
|
- Overrides
- Source
_setProj(angle, aspect)#
Sets up camera projection
Name | Type | Description |
---|---|---|
angle | number | Camera view angle |
aspect | number | Screen aspect ratio |
- Overrides
- Source
checkFly()#
Prepare camera to the frame. Used in render node frame function.
- Source
flyCartesian(cartesian, lookopt, upopt, amplopt, completeCallbackopt, startCallbackopt, frameCallbackopt)#
Flies to the cartesian coordinates.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
cartesian | Vec3 | Finish cartesian coordinates. | ||
look | Vec3 | <optional> | Camera LOOK in the end of flying. Default - (0,0,0) | |
up | Vec3 | <optional> | Camera UP vector in the end of flying. Default - (0,1,0) | |
ampl | Number | <optional> | 1.0 | Altitude amplitude factor. |
completeCallback | function | <optional> | Callback that calls after flying when flying is finished. | |
startCallback | function | <optional> | Callback that calls before the flying begins. | |
frameCallback | function | <optional> | Each frame callback |
- Source
flyExtent(extent, heightopt, upopt, amplopt, completeCallbackopt, startCallbackopt, frameCallbackopt)#
Flies to the current extent.
Name | Type | Attributes | Description |
---|---|---|---|
extent | Extent | Current extent. | |
height | number | <optional> | Destination height. |
up | Vec3 | <optional> | Camera UP in the end of flying. Default - (0,1,0) |
ampl | Number | <optional> | Altitude amplitude factor. |
completeCallback | function | <optional> | Callback that calls after flying when flying is finished. |
startCallback | function | <optional> | Callback that calls before the flying begins. |
frameCallback | function | <optional> | Each frame callback |
- Source
flyLonLat(lonlat, lookopt, upopt, amplopt, completeCallbackopt, startCallbackopt, frameCallbackopt)#
Flies to the geo coordinates.
Name | Type | Attributes | Description |
---|---|---|---|
lonlat | LonLat | Finish coordinates. | |
look | Vec3 | | <optional> | Camera LOOK in the end of flying. Default - (0,0,0) |
up | Vec3 | <optional> | Camera UP vector in the end of flying. Default - (0,1,0) |
ampl | number | <optional> | Altitude amplitude factor. |
completeCallback | function | <optional> | Callback that calls after flying when flying is finished. |
startCallback | function | <optional> | Callback that calls befor the flying begins. |
frameCallback | function | <optional> | each frame callback |
- Source
getAltitude()#
Gets altitude over the terrain.
- Source
getAspectRatio() → {number}#
Returns aspect ratio
- Overrides
- Source
- Aspect ratio
- Type:
- number
getExtentPosition(extent, height) → {Vec3}#
Gets position by viewable extent.
Name | Type | Description |
---|---|---|
extent | Extent | Viewable extent. |
height | Number | Camera height |
- Source
- Type:
- Vec3
getHeight() → {number}#
Returns camera height.
- Source
- Type:
- number
getInverseProjectionMatrix() → {Mat4}#
Returns inverse projection matrix.
- Overrides
- Source
- Inverse projection-view matrix.
- Type:
- Mat4
getInverseProjectionViewMatrix() → {Mat4}#
Returns inverse projection and model matrix product.
- Source
- Inverse projection-view matrix.
- Type:
- Mat4
getLonLat() → {LonLat}#
Returns camera geographical position.
- Source
- Type:
- LonLat
getNormalMatrix() → {NumberArray9}#
Returns normal matrix.
- Overrides
- Source
- Normal matrix.
- Type:
- NumberArray9
getProjectionMatrix() → {Mat4}#
Returns projection matrix.
- Overrides
- Source
- Projection matrix.
- Type:
- Mat4
getProjectionViewMatrix() → {Mat4}#
Returns projection and model matrix product.
- Overrides
- Source
- Projection-view matrix.
- Type:
- Mat4
getViewAngle() → {number}#
Gets camera view angle in degrees
- Overrides
- Source
angle -
- Type:
- number
getViewMatrix() → {NumberArray16}#
Returns model matrix.
- Overrides
- Source
- View matrix.
- Type:
- NumberArray16
isFlying() → {boolean}#
Returns camera is flying.
- Source
- Type:
- boolean
look(look, upopt)#
Sets camera look point
- Overrides
- Source
pitch(angle)#
Pitch the camera to the angle in degrees
Name | Type | Description |
---|---|---|
angle | number | Delta pitch angle in degrees |
- Overrides
- Source
project(v) → {Vec2}#
Gets projected 3d point to the 2d screen coordinates
Name | Type | Description |
---|---|---|
v | Vec3 | Cartesian 3d coordinates |
- Overrides
- Source
- Screen point coordinates
- Type:
- Vec2
projectedSize(p, r) → {number}#
Gets 3d size factor. Uses in LOD distance calculation.
- Overrides
- Source
- Size factor.
- Type:
- number
refresh()#
Refresh camera matrices
- Overrides
- Source
roll(angle)#
Roll the camera to the angle in degrees
Name | Type | Description |
---|---|---|
angle | number | Delta roll angle in degrees |
- Overrides
- Source
rotateAround(angle, isArcopt, centeropt, upopt)#
Rotates camera around center point
- Overrides
- Source
rotateDown(angle)#
Rotates around planet to the South Pole.
Name | Type | Description |
---|---|---|
angle | number | Rotation angle. |
- Source
rotateHorizontal(angle, isArcopt, centeropt, upopt)#
Rotates camera around center point by horizontal.
- Overrides
- Source
rotateLeft(angle, spinopt)#
Rotates around planet to the left.
Name | Type | Attributes | Description |
---|---|---|---|
angle | number | Rotation angle. | |
spin | boolean | <optional> | If its true rotates around globe spin. |
- Source
rotateRight(angle, spinopt)#
Rotates around planet to the right.
Name | Type | Attributes | Description |
---|---|---|---|
angle | number | Rotation angle. | |
spin | boolean | <optional> | If its true rotates around globe spin. |
- Source
rotateUp(angle)#
Rotates around planet to the North Pole.
Name | Type | Description |
---|---|---|
angle | number | Rotation angle. |
- Source
rotateVertical(angle, centeropt)#
Rotates camera around center point by vertical.
Name | Type | Attributes | Description |
---|---|---|---|
angle | number | Rotation angle in radians. | |
center | Vec3 | <optional> | Point that the camera rotates around. |
- Overrides
- Source
set(eye, look, up) → {Camera}#
Sets camera to eye position
- Overrides
- Source
- This camera
- Type:
- Camera
setAltitude(alt)#
Sets altitude over the terrain.
Name | Type | Description |
---|---|---|
alt | number | Altitude over the terrain. |
- Source
setAspectRatio(aspect)#
Sets aspect ratio
Name | Type | Description |
---|---|---|
aspect | Number | Camera aspect ratio |
- Overrides
- Source
setLonLat(lonlat, lookLonLatopt, upopt)#
Places camera to view to the geographical point.
- Source
setViewAngle(angle)#
Sets camera view angle in degrees
Name | Type | Description |
---|---|---|
angle | number | View angle |
- Overrides
- Source
slide(du, dv, dn)#
Slides camera to vector d - (du, dv, dn)
Name | Type | Description |
---|---|---|
du | number | delta X |
dv | number | delta Y |
dn | number | delta Z |
- Overrides
- Source
stopFlying()#
Breaks the flight.
- Source
unproject(x, y) → {Vec3}#
Returns normal vector direction to the unprojected screen point from camera eye
Name | Type | Description |
---|---|---|
x | number | Screen X coordinate |
y | number | Screen Y coordinate |
- Overrides
- Source
- Direction vector
- Type:
- Vec3
(abstract) update()#
Updates camera view space.
- Overrides
- Source
viewExtent(extent, heightopt)#
View current extent.
Name | Type | Attributes | Description |
---|---|---|---|
extent | Extent | Current extent. | |
height | number | <optional> |
- Source
yaw(angle)#
Yaw the camera to the angle in degrees
Name | Type | Description |
---|---|---|
angle | number | Delta yaw angle in degrees |
- Overrides
- Source