onFlyTo Event

Fires every time the fly through starts flying to a new waypoint.

SGFlyThrough.onFlyTo = myOnFlyTo;

function myOnFlyTo(obj)

 

Parameter

Description

obj

The object to which the fly through is currently flying to. Can be one of the following:

SGNode, SGPosition, SGCoord2D, SGCoord3D

Return Value

To skip the next waypoint return false from the onFlyTo event handler.

To stop the fly through completely, either call SGFlyTrhough.finish() or  SGWorld.navigate.stop().

Remarks

The fly through mechanism composed of a series of smaller “fly to” steps. Before each “fly to” step starts, the onFlyTo events fires, giving a chance to query information about the destination object. In addition, the waypoint can be skipped if the return value is false. To stop the fly through completely, either call SGFlyTrhough.finish() or  SGWorld.navigate.stop().