Use this method to add a waypoint to the list of waypoints that the object should follow.
HRESULT AddWaypoint(
[in] double X,
[in] double Height,
[in] double Y,
[in] double Speed,
[in, defaultvalue(-1)] int Index)
Parameters:
X – The West-East coordinate of the waypoint in MPT units. You can use the ITerrain interface to retrieve information about the MPT units. If you are working in Lat-Long format, the Lat-Long values are in decimal Lat-Long.
Height – The height of the waypoint, in meters. The way this parameter is interpreted depends on the HeightStyle parameter that was used during the creation of the dynamic object (IObjectManager51::CreateDynamicObject()).
Y – The North-South coordinate of the waypoint in MPT units. You can use the ITerrain interface to retrieve information about the MPT units. If you are working in Lat-Long format, the Lat-Long values are in decimal Lat-Long.
Speed – The speed in meters per second that the object should have at this waypoint
Index – A zero based index of the waypoint to add. If this value is –1 the new waypoint is appended to the end of the list of waypoints. Otherwise, the new waypoint is inserted at that index.
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_TEOBJECT_NOLONGEREXIST |
The object you are trying to access no longer exists. This may have occurred because, while keeping an interface to the object, the user deleted it from TerraExplorer (via the TE user interface). Without the object, the interface cannot be used. Therefore, you should release the interface. |
TE_E_INTERNAL |
TerraExplorer was unable to create the object. To get more information about this error use the IErrorInfo Interface. |