Class: PlanetCamera

og/camera/PlanetCamera~PlanetCamera

Planet camera.

new PlanetCamera(planet, options)

Name Type Description
planet og.RenderNode Planet render node.
options Object optional Planet camera options:
Name Type Description
name Object optional Camera name.
viewAngle number optional Camera angle of view. Default is 35.0
near number optional Camera near plane distance. Default is 1.0
far number optional Camera far plane distance. Deafult is og.math.MAX
minAltitude number optional Minimal altitude for the camera. Deafult is 50
eye og.Vec3 optional Camera eye position. Default (0,0,0)
look og.Vec3 optional Camera look position. Default (0,0,0)
up og.Vec3 optional Camera eye position. Default (0,1,0)

Extends

Members

protected_insideSegmentog.quadTree.Node

Quad node that camera flies over.

protected_insideSegmentPositionog.LonLat

Coordinates that depends on what segment class we are fling over. It can be WGS84 or Mercator coordinates. Gets in og.quadTree.Node

protected_lonLatog.LonLat

Current geographical degree position.

protected_lonLatMercog.LonLat

Current geographical mercator position.

protected_terrainAltitudenumber

Current altitude.

protected_terrainPointog.Vec3

Cartesian coordinates on the terrain.

minAltitudenumber

Minimal alltitude that camera can reach over the terrain.
Assigned camera's planet.

Methods

abstractclone(){og.PlanetCamera}

Clone planet camera instance to another one.
Returns:
Type Description
og.PlanetCamera

flyCartesian(cartesian, look, up, completeCallback, startCallback)

Flies to the cartesian coordinates.
Name Type Description
cartesian og.Vec3 Finish cartesian coordinates.
look og.Vec3 optional Camera LOOK in the end of flying. Default - (0,0,0)
up og.Vec3 optional Camera UP vector in the end of flying. Default - (0,1,0)
completeCallback cameraCallback optional Callback that calls after flying when flying is finished.
startCallback cameraCallback optional Callback that calls befor the flying begins.

flyExtent(extent, up, completeCallback, startCallback)

Flies to the current extent.
Name Type Description
extent og.Extent Current extent.
up og.Vec3 optional Camera UP in the end of flying. Default - (0,1,0)
completeCallback cameraCallback optional Callback that calls after flying when flying is finished.
startCallback cameraCallback optional Callback that calls befor the flying begins.

flyLonLat(lonlat, look, up, completeCallback, startCallback)

Flies to the geo coordiantes.
Name Type Description
lonlat og.LonLat Finish coordinates.
look og.Vec3 optional Camera LOOK in the end of flying. Default - (0,0,0)
up og.Vec3 optional Camera UP vector in the end of flying. Default - (0,1,0)
completeCallback cameraCallback optional Callback that calls after flying when flying is finished.
startCallback cameraCallback optional Callback that calls befor the flying begins.
Gets altitude over the terrain.

getExtentPosition(extent){og.Vec3}

Gets position by viewable extent.
Name Type Description
extent og.Extent Viewable extent.
Returns:
Type Description
og.Vec3

getHeight(){number}

Returns camera height.
Returns:
Type Description
number

getLonLat(){og.LonLat}

Returns camera geographical position.
Returns:
Type Description
og.LonLat

isFlying(){boolean}

Returns camera is flying.
Returns:
Type Description
boolean
Prepare camera to the frame. Used in render node frame function.

rotateDown(angle)

Rotates around planet to the south pole.
Name Type Description
angle number Rotation angle.

rotateLeft(angle, spin)

Rotates around planet to the left.
Name Type Description
angle number Rotation angle.
spin boolean optional If its true rotates around globe spin.

rotateRight(angle, spin)

Rotates around planet to the right.
Name Type Description
angle number Rotation angle.
spin boolean optional If its true rotates around globe spin.
Rotates around planet to the north pole.
Name Type Description
angle number Rotation angle.
Sets altitude over the terrain.
Name Type Description
alt number Altitude over the terrain.

setLonLat(lonlat, lookLonLat, up)

Places camera to view to the geographical point.
Name Type Description
lonlat og.LonLat New camera and camera view position.
lookLonLat og.LonLat optional Look up coordinates.
up og.Vec3 optional Camera UP vector. Default (0,1,0)
Breaks the flight.
Updates camera view space.

viewExtent(extent)

View current extent.
Name Type Description
extent og.Extent Current extent.

Events

Camera is stopped.
When camera has been updated.