The FlyToObject method indicates what object or group the camera focuses on and how it approaches the object. When an ID of a group is passed, the focus point is calculated automatically as the center of the first objects. When an ID of a layer is passed, the focus point is calculated as the center of the layer bounding box.
HRESULT FlyToObject(
[in] BSTR ObjectID,
[in] ActionCode Code)
Parameters:
ObjectID – The ID of the object that you want to approach.
Code – An enum that
determines how you fly to the object. The following are the
possible ActionCode values:
Note: AC_PLAY utilizes the default activation action for the
object. For ITerrainRoute5 objects it plays the route.
Note: Some options do not affect all object types. For
example, AC_FOLLWCOCKPIT does not affect a ground object.
AC_FLYTO = 0
AC_CIRCLEPATTERN = 1
AC_OVALPATTERN = 2
AC_LINEPATTERN = 3
AC_ARCPATTERN = 4
AC_FOLLOWBEHIND = 5
AC_FOLLOWABOVE = 6
AC_FOLLOWBELOW = 7
AC_FOLLOWRIGHT = 8
AC_FOLLOWLEFT = 9
AC_FOLLOWBEHINDANDABOVE = 10
AC_FOLLOWCOCKPIT = 11
AC_JUMP = 14
AC_PLAY = 18
Return Values:
The return value obtained from the returned HRESULT can be one of the following:
Return value |
Meaning |
S_OK |
Success. |
E_FAIL |
Catastrophic failure. |
TE_E_MPTNOTLOADED |
An MPT file must be loaded in TerraExplorer for this method to work. |
TE_E_OBJMANAGER_OBJNOTFOUND |
The requested object was not found. |