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
getHeading()
should be yje same as getYaw
- Source
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
getProjectionViewRTEMatrix() → {Mat4}
Returns projection and model RTE matrix product.
- Overrides
- Source
- Projection-view matrix.
- Type:
- Mat4
getRotation()
Returns camera quaternion
- Overrides
- Source
getViewAngle() → {number}
Gets camera view angle in degrees
- Overrides
- Source
angle -
- Type:
- number
getViewMatrix() → {NumberArray16}
Returns model matrix.
- Overrides
- Source
- View matrix.
- Type:
- NumberArray16
getYaw()
should be the same as getHeading
- Source
isFlying() → {boolean}
Returns camera is flying.
- Source
- Type:
- boolean
look(look, upopt)
Sets camera look point
Name | Type | Attributes | Description |
---|---|---|---|
look | Vec3 | Look point | |
up | Vec3 | <optional> | Camera up vector otherwise camera current up vector(this._u) |
- Overrides
- Source
project(x, y, z) → {Vec2}
Gets projected 3d point to the 2d screen coordinates
Name | Type | Description |
---|---|---|
x | number | X coordinate |
y | number | Y coordinate |
z | number | Z coordinate |
- Overrides
- Source
- Screen point coordinates
- Type:
- Vec2
project3v(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
rotateAround(angle, isArcopt, centeropt, upopt)
Rotates camera around center point
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
angle | number | Rotation angle in radians | ||
isArc | boolean | <optional> | false | If true camera up vector gets from current up vector every frame, otherwise up is always input parameter. |
center | Vec3 | <optional> | Point that the camera rotates around | |
up | Vec3 | <optional> | Camera up vector |
- 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.
Name | Type | Attributes | Description |
---|---|---|---|
angle | number | Rotation angle in radians. | |
isArc | boolean | <optional> | If true camera up vector gets from current up vector every frame, otherwise up is always input parameter. |
center | Vec3 | <optional> | Point that the camera rotates around. |
up | Vec3 | <optional> | Camera up vector. |
- 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
setLonLat(lonlat, lookLonLatopt, upopt)
Places camera to view to the geographical point.
Name | Type | Attributes | Description |
---|---|---|---|
lonlat | LonLat | New camera and camera view position. | |
lookLonLat | LonLat | <optional> | Look up coordinates. |
up | Vec3 | <optional> | Camera UP vector. Default (0,1,0) |
- Source
setPitch(angle)
Pitch the camera to the angle in radians
Name | Type | Description |
---|---|---|
angle | number | Delta pitch angle in radians |
- Overrides
- Source
setRoll(angle)
Roll the camera to the angle in radians
Name | Type | Description |
---|---|---|
angle | number | Delta roll angle in radians |
- Overrides
- Source
setViewAngle(angle)
Sets camera view angle in degrees
Name | Type | Description |
---|---|---|
angle | number | View angle |
- Overrides
- Source
setYaw(angle)
Yaw the camera to the angle in radians
Name | Type | Description |
---|---|---|
angle | number | Delta yaw angle in radians |
- 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
unproject2v(pos) → {Vec3}
Returns normal vector direction to the unprojected screen point from camera eye
Name | Type | Description |
---|---|---|
pos | Vec2 | Screen X 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