Navigate (INavigate80)

The INavigate80 interface gives you control of the camera in terms of positioning, orientation, and speed. You can also set how the camera approaches a certain object, and perform zoom operations.

 

 

Properties

 

FieldOfView

Gets and sets the camera field of view, in degrees.

Speed

Gets and sets the speed at which the camera approaches an object.

UndergroundMode

Gets and sets a Boolean value that indicates whether the underground mode is on or off.

 

Methods

 

DetectCollisionToTarget

Returns the distance to the first ground object detected on the path from the current camera position to the target parameter.

FlyThrough

Reserved. Currently not used.

FlyTo

Instructs the camera to fly to a point of interest in a specific pattern.

GetPosition

Returns the camera’s current position and orientation.

JumpTo

Instructs the camera to jump straight to the point of interest.

SetGPSMode

Sets the GPS mode.

SetGPSPosition

Sets the GPS position.

SetPosition

Sets the camera’s position and orientation.

Stop

Stops the camera’s movement.

ZoomIn

Moves the camera forward, closer to the point of interest.

ZoomOut

Moves the camera backward, farther from the point of interest.

ZoomTo

Moves the camera to a specific distance from the terrain.

 

FieldOfView

Gets and sets the camera field of view, in degrees. This number must be between 1° and 127°, where 1° is the maximum zoom in and 127° is the maximum zoom out. The default field of view is 53°.

 

JavaScript

 

FieldOfView

 

C#

 

double FieldOfView { get; set; }

 

C++

 

HRESULT FieldOfView([out, retval] double* pVal)

HRESULT FieldOfView([in] double pVal)

Speed

Gets and sets the speed at which the camera approaches an object.

JavaScript

 

Speed

 

C#

 

double Speed { get; set; }

 

C++

 

HRESULT Speed([out, retval] double* pVal)

HRESULT Speed([in] double pVal)

 

UndergroundMode

Gets and sets a Boolean value that determines whether the underground mode is on or off. The underground navigation mode allows you to explore the subsurface of the terrain. A subsurface grid navigation aid appears when you navigate below the terrain, allowing you to navigate the same way as above ground.

 

JavaScript

 

UndergroundMode

 

C#

 

bool UndergroundMode { get; set; }

 

C++

 

HRESULT UndergroundMode([out, retval] VARIANT_BOOL* pVal)

HRESULT UndergroundMode([in] VARIANT_BOOL pVal)

 

DetectCollisionToTarget

Returns the distance to the first ground object detected on the path from the current camera position to the target parameter. The target parameter defines the direction and endpoint of this path.

If there is no collision between the viewer and target, 0 is returned.

 

JavaScript

 

DetectCollisionToTarget(

       target)

 

C#

 

double DetectCollisionToTarget (

       IPosition80 target)

 

C++

 

HRESULT DetectCollisionToTarget (

       IPosition80* target,

       double* Distance)

 

Parameters

target

An IPosition80representing the position of the endpoint of the path (that begins at the current camera position) that is being queried for the presence of a ground object.

Return Value

Distance

The distance to the first ground object detected on the path from the current camera position to the target parameter.

Exceptions

See: HRESULT Return Values for a list of possible values returned by the HRESULT.

 

FlyTo

This method instructs the plane to fly to an object, approaching and focusing in on the object according to the value set in the Pattern parameter.

 

JavaScript

 

FlyTo(

       target,

       Pattern )

 

C#

 

void FlyTo(

       object target,

       ActionCode Pattern = ActionCode.AC_FLYTO)

 

C++

 

HRESULT FlyTo(

       VARIANT target,

       ActionCode Pattern) 

Parameters

target

The object to fly to. This parameter can be any of the following:

·          An object ID represented as a string.

·          ITerraExplorerObject80 derived object

·          ProjectTree GroupID

·          IPosition80 object

Pattern

An enum that instructs the plane on how to approach and focus in on the object. The following are possible values:

·          AC_FLYTO = 0,
Fly to the object.

·          AC_CIRCLEPATTERN = 1,
Perform a circle flight around the object.

·          AC_OVALPATTERN = 2,
Perform an oval flight pattern around the object.

·          AC_LINEPATTERN = 3,
Perform a tight oval flight pattern around the object.

·          AC_ARCPATTERN = 4,
Perform a vertical arc flight above the object.

·          AC_FOLLOWBEHIND = 5,
View the object from behind.

·          AC_FOLLOWABOVE = 6,
View the object from above.

·          AC_FOLLOWBELOW = 7,
View the object from below.

·          AC_FOLLOWRIGHT = 8,
View the object from the right-hand side.

·          AC_FOLLOWLEFT = 9,
View the object from the left-hand side.

·          AC_FOLLOWBEHINDANDABOVE = 10,
View the object from behind and above (45 degrees).

·          AC_FOLLOWCOCKPIT = 11,
View the world from the object’s pivot point.

·          AC_FOLLOWFROMGROUND = 12,
View the object from the ground.

·          AC_STOP = 13,
Stop the flight to an object.

·          AC_JUMP = 14,
Jump directly to the object.

·          AC_PLAY = 18,
Play the object's activation action.

Exceptions

See: HRESULT Return Values for a list of possible values returned by the HRESULT.

GetPosition

This method returns the camera’s position and orientation.

               

JavaScript

 

GetPosition(

       AltitudeType)

 

C#

 

IPosition80 GetPosition(

       AltitudeTypeCode AltitudeType = AltitudeTypeCode.ATC_TERRAIN_RELATIVE)

 

C++

 

HRESULT GetPosition(

       AltitudeTypeCode AltitudeType,

       IPosition80 ** pVal) 

Parameters

AltitudeType

An enum determining how the altitude is interpreted. The following are the possible values:

·          ATC_TERRAIN_RELATIVE = 0
Places the object’s pivot point at a specified altitude above the ground.

·          ATC_TERRAIN_ABSOLUTE = 3
Places the object’s pivot point at a specified altitude above the terrain database vertical datum base ellipsoid.

·          ATC_3DML_RELATIVE = 4
Places the object’s pivot point at a specified altitude above the 3DML layer.

Note:    ATC_PIVOT_RELATIVE and ATC_ON_TERRAIN values apply only for 2D shapes and polygons. ATC_3DML_RELATIVE only applies to image and text labels.

Return Value

pVal

An IPosition80 representing the position of the camera, defined by its coordinates in the 3D World.

Exceptions

See: HRESULT Return Values for a list of possible values returned by the HRESULT.

JumpTo

Instructs the camera to jump straight to the point of interest.

 

JavaScript

 

JumpTo(

       target)

 

C#

 

void JumpTo(

       object target)

 

C++

 

HRESULT JumpTo(

       VARIANT target)

 

Parameters

target

The object to jump to. This parameter can be any of the following:

·          An object ID represented as a string.

·          ITerraExplorerObject80 derived object

·          ProjectTree GroupID

·          IPosition80 object

Exceptions

See: HRESULT Return Values for a list of possible values returned by the HRESULT.

SetGPSMode

Sets the GPS mode.

Note:    Before setting the mode to GPS_MODE_SHOW_LOCATION_INDICATOR or GPS_MODE_FOLLOW, the client should call SetGPSPosition to update the true GPS position.

 

JavaScript

 

SetGPSMode(

       GPSMode)

 

C#

 

void SetGPSMode (

       GPSOperationMode GPSMode)

 

C++

 

HRESULT SetGPSMode (

       GPSOperationMode GPSMode)

 

Parameters

GPSMode

An enum that can use any of the following values:

·          GPS_MODE_OFF = 0,
Turn GPS mode off.

·          GPS_MODE_SHOW_LOCATION_INDICATOR = 2,
Indicate the current GPS location on the 3D Window (but don't follow the GPS position with the camera)

·          GPS_MODE_FOLLOW = 4,
Camera follows GPS position.

·          GPS_MODE_NONE = 999
Internal use only. Client should not call SetGPSMode with this flag.

Exceptions

See: HRESULT Return Values for a list of possible values returned by the HRESULT.

SetGPSPosition

Sets the GPS position.

 

JavaScript

 

SetGPSPosition(

       Position)

 

C#

 

void SetGPSPosition (

       IPosition80 Position)

 

C++

 

HRESULT SetGPSPosition (

       IPosition80 * Position)

 

Parameters

Position

An IPosition80 representing the position of the camera, defined by its coordinates in the 3D World.

Exceptions

See: HRESULT Return Values for a list of possible values returned by the HRESULT.

SetPosition

Sets the position of the camera in the 3D World.

 

JavaScript

 

SetPosition(

       Position)

 

C#

 

void SetPosition(

       IPosition80 Position)

 

C++

 

HRESULT SetPosition(

       IPosition80 * Position)

 

Parameters

Position

An IPosition80 representing the position of the camera, defined by its coordinates in the 3D World.

Exceptions

See: HRESULT Return Values for a list of possible values returned by the HRESULT.

Stop

Stops the camera movement.

 

JavaScript

 

Stop()

 

C#

 

void Stop() 

 

C++

 

HRESULT Stop()

 

ZoomIn

Moves the camera forward, closer to the point of interest.

 

JavaScript

 

ZoomIn(

       delta)

 

C#

 

void ZoomIn(

       double delta = 0)

 

C++

 

HRESULT ZoomIn(

       double delta)

 

Parameters

delta

Distance to move forward.

Exceptions

See: HRESULT Return Values for a list of possible values returned by the HRESULT.

Remarks

If the delta parameter is not specified, the ZoomIn method shortens the distance between the camera and the point of interest by a third. If the delta parameter is negative, the method zooms out.

ZoomOut

Moves the camera backward, farther from the point of interest.

 

JavaScript

 

ZoomOut(delta)

 

C#

 

void ZoomOut(

       double delta = 0)

 

C++

 

HRESULT ZoomOut(

       double delta)

Parameters

delta

Distance to move backward.

Exceptions

See: HRESULT Return Values for a list of possible values returned by the HRESULT.

Remarks

If the delta parameter is not specified, the ZoomOut method triples the distance between the camera and the point of interest.

If the delta parameter is negative, the method zooms in.

ZoomTo

This method controls the zooming operation of the camera. The distanceFromPOI parameter specifies the distance from the ground at the center point of the 3D Window where the zoom operation stops.

 

JavaScript

 

ZoomTo(

       distanceFromPOI,

       Flags)

 

C#

 

void ZoomTo(

       double distanceFromPOI,

       int Flags = 0)

 

C++

 

HRESULT ZoomTo(

       double distanceFromPOI,

       long Flags) 

Parameters

distanceFromPOI

The distance from the camera to the point on the terrain that the camera center is looking at.

Flags

Reserved. Always pass 0 (zero).

Exceptions

See: HRESULT Return Values for a list of possible values returned by the HRESULT.

Remarks

The outcome of the zoomTo operation depends on the current distance between the camera and the camera’s point of interest (POI) at the center of the view. If distanceFromPOI is bigger than the current distance between the camera and the point of interest, the camera moves backwards. If it is smaller, it moves forward.