Class: PlanetCamera

og.PlanetCamera

new og.PlanetCamera(planet, options)

Planet camera.
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.math.Vector3 optional Camera eye position. Default (0,0,0)
look og.math.Vector3 optional Camera look position. Default (0,0,0)
up og.math.Vector3 optional Camera eye position. Default (0,1,0)

Extends

Members

protected_aspectNumber

Aspect ratio.

protected_farDistNumber

Camera far distance.

protected_insideSegmentog.quadTree.QuadNode

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.QuadNode

protected_inverseProjectionViewMatrixog.math.Matrix4

Inverse projectionView Matrix.

protected_lonLatog.LonLat

Current geographical degree position.

protected_lonLatMercog.LonLat

Current geographical mercator position.

protected_nog.math.Vector3

Camera forward vector.

protected_nearDistNumber

Camera near distance.

protected_normalMatrixog.math.Matrix3

Camera normal matrix.

protected_projectionMatrixog.math.Matrix4

Camera projection matrix.

protected_projectionMatrixPreciseog.math.Matrix4

Camera projection matrix for small near and far distances.

protected_projectionViewMatrixog.math.Matrix4

Product of projection and view matrices.

protected_terrainAltitudenumber

Current altitude.

protected_terrainPointog.math.Vector3

Cartesian coordinates on the terrain.

protected_uog.math.Vector3

Camera right vector.

protected_vog.math.Vector3

Camera up vector.

protected_viewAngleNumber

Camera view angle in degrees.

protected_viewMatrixog.math.Matrix4

Camera view matrix.

eventsog.Events

Camera events handler.
Camera position.

frustumog.Frustum

Camera frustum.

minAltitudenumber

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

rendererog.Renderer

Assigned renderer.

Methods

inherited protected_setViewMatrix()

Updates model view matrix.
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.math.Vector3 Finish cartesian coordinates.
look og.math.Vector3 optional Camera LOOK in the end of flying. Default - (0,0,0)
up og.math.Vector3 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.math.Vector3 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.math.Vector3 optional Camera LOOK in the end of flying. Default - (0,0,0)
up og.math.Vector3 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.

inherited getAspectRatio(){number}

Returns aspect ratio.
Returns:
Type Description
number

getExtentPosition(extent){og.math.Vector3}

Gets position by viewable extent.
Name Type Description
extent og.Extent Viewable extent.
Returns:
Type Description
og.math.Vector3
Gets far distance.
Returns:
Type Description
number

getHeight(){number}

Returns camera height.
Returns:
Type Description
number

inherited getInverseProjecttionViewMatrix()

Returns inverse projection and model matrix product.
Returns camera geographical position.
Returns:
Type Description
og.LonLat
Gets near distance.
Returns:
Type Description
number
Returns normal matrix.

inherited getProjectionMatrix()

Returns projection matrix.

inherited getProjectionViewMatrix()

Returns projection and model matrix product.
Returns model matrix.

inherited initialize(renderer, options)

Camera initialization.
Name Type Description
renderer og.Renderer OpenGlobus renderer object.
options Object optional Camera options:
Name Type Description
viewAngle number optional Camera angle of view. Default is 30.0
near number optional Camera near plane distance. Default is 1.0
far number optional Camera far plane distance. Deafult is og.math.MAX
eye og.math.Vector3 optional Camera eye position. Default (0,0,0)
look og.math.Vector3 optional Camera look position. Default (0,0,0)
up og.math.Vector3 optional Camera eye position. Default (0,1,0)

isFlying(){boolean}

Returns camera is flying.
Returns:
Type Description
boolean
Sets camera look point.
Name Type Description
look og.math.Vector3 Look point.
up og.math.Vector3 optional Camera up vector otherwise camera current up vector(this._v)
Pitch the camera to the angle in degrees.
Name Type Description
angle number Delta pitch angle in degrees.
Prepare camera to the frame. Used in render node frame function.
Gets projected 3d point to the 2d screen coordiantes.
Name Type Description
v og.math.Vector3 Cartesian 3d coordiantes.
Returns:
Type Description
og.math.Vector2

inherited projectedSize(p){number}

Gets 3d size factor. Uses in LOD distance calculation.
Name Type Description
p og.math.Vector3 Far point.
Returns:
Type Description
number
Refresh camera matrices.
Roll the camera to the angle in degrees.
Name Type Description
angle number Delta roll angle in degrees.

inherited rotateAround(angle, isArc, center, up)

Rotates camera around center point.
Name Type Description
angle number Rotation angle in radians.
isArc boolaen If true camera up vector gets from current up vector every frame, otherwise up is always input parameter.
center og.math.Vector3 Point that the camera rotates around.
up og.math.Vecto3 optional Camera up vector.

rotateDown(angle)

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

inherited rotateHorizontal(angle, isArc, center, up)

Rotates camera around center point by horizontal.
Name Type Description
angle number Rotation angle in radians.
isArc boolaen If true camera up vector gets from current up vector every frame, otherwise up is always input parameter.
center og.math.Vector3 Point that the camera rotates around.
up og.math.Vecto3 optional Camera up vector.

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.

inherited rotateVertical(angle, center)

Rotates camera around center point by vecrtical.
Name Type Description
angle number Rotation angle in radians.
center og.math.Vector3 Point that the camera rotates around.

inherited set(eye, look, up)

Sets camera to eye position.
Name Type Description
eye og.math.Vector3 Camera position.
look og.math.Vector3 Look point.
up og.math.Vector3 Camera up vector.
Sets altitude over the terrain.
Name Type Description
alt number Altitude over the terrain.

inherited setAspectRatio(aspect)

Sets aspect ratio.
Name Type Description
aspect Number Camera aspect ratio.
Sets far camera distance.
Name Type Description
distance number Far distance.

setLonLat(lonlat)

Moves camera to the geographical position.
Name Type Description
lonlat og.LonLat Geographical position.
Sets camera's near distance.
Name Type Description
distance number Near distance.

inherited setProjectionMatrix(angle, aspect, near, far)

Sets up camera projection matrix.
Name Type Description
angle nnumber Camera's view angle.
aspect number Screen aspect ration.
near number Near camera distance.
far number Far camera distance.

inherited setViewAngle(angle)

Sets camera view angle in degrees.
Name Type Description
angle number View angle.
Slides camera to vector d - (du, dv, dn).
Name Type Description
du number delta X.
dv number delta Y.
dn number delta Z.
Breaks the flight.
Returns normal vector direction to to the unprojected screen point from camera eye.
Name Type Description
x number Scren X coordinate.
y number Scren Y coordinate.
Updates camera view space.

viewExtent(extent)

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

viewLonLat(lonlat, up)

Places camera to view to the geographical point.
Name Type Description
lonlat og.LonLat New camera and camera view position.
up og.math.Vector3 optional Camera UP vector. Default (0,1,0)
Yaw the camera to the angle in degrees.
Name Type Description
angle number Delta yaw angle in degrees.

Events

Every camera updates event.