Interface: Navigation

Navigation

Navigation is an interface that provides some methods used to control the camera.
AstroNavigation Provides a camera located at the center of the scene. The camera is inside the globe. It is used to view the sky
PlanetNavigation Provides a camera, located outside the globe and looking at the globe. It is used to view a planet
FlatNavigation Provides a camera to navigate on a 2D map - Only available in a Planet context
See:

Methods


getType()

Returns the type of navigation.
Returns:
the type of navigation
Type
NAVIGATION

getOptions()

Returns the navigation's options at the initialisation.
Returns:
Options
Type
Object

start()

Starts the navigation.

stop()

Stops the navigation.

stopAnimations()

Stops the animations.

getFov()

Returns the field of view in decimal degree.
Returns:
the Field of view [fov along width, fov along height]
Type
Array.<float>

moveUpTo(vec [, duration])

Moves up vector.
Parameters:
Name Type Argument Default Description
vec Array.<float> 3D Vector
duration int <optional>
1000 Duration of animation in milliseconds

getCenter()

Returns the center of the field of view.
Returns:
the center in decimal degree of the field of view [longitude, latitude]
Type
Array.<float>

rotate(dx, dy)

Rotates the camera.
Parameters:
Name Type Description
dx float Window delta x
dy float Window delta y

pan(dx, dy)

Pans the camera to a direction up/down or left/right with the same distance from the object
Parameters:
Name Type Description
dx float Window direction left/right
dy float Window direction up/down

zoom(delta, scale)

Applies zooming.
Parameters:
Name Type Description
delta float Delta zoom
scale float Scale

zoomTo(geoPos, options)

Zooms to a 2D position (longitude, latitude).
Parameters:
Name Type Description
geoPos Array.<float> spatial position in decimal degree [longitude, latitude]
options Object options for the selected navigation

toViewMatrix(mat, fov, duration, callback)

Basic animation from current view matrix to the given one
Parameters:
Name Type Description
mat Array.<Object> Destination view matrix (array of 16)
fov int Final zooming fov in degrees
duration int Duration of animation in milliseconds
callback function Callback on the end of animation

getRenderContext()

Returns the rendering context.
Returns:
the rendering context
Type
RenderContext

setRenderContext(renderContext)

Sets the rendering context
Parameters:
Name Type Description
renderContext RenderContext the rendering context to set

applyLocalRotation()

Applies to rotation matrix

computeViewMatrix()

Computes the view matrix