Updates the position of the camera in the 3D World. Unlike SetPosition(), this method should be used as part of a flowing motion (by which it is more efficient when moving the camera position by short distance from the current camera position). A typical scenario would be to handle _ITerraExplorerEvents2::OnFrame() event and to call the MovePosition() method to update the camera position as a response to a user input.
HRESULT MovePosition(
[in] double X,
[in] double Y,
[in] double Height,
[in] double Yaw,
[in] double Pitch,
[in] double Roll,
[in] double CameraDeltaYaw,
[in] double CameraDeltaPitch,
[in, defaultvalue(0)] long Flags)
Parameters:
X – The East-West coordinate of the camera position represented in MPT units. You can use the ITerrain interface to retrieve information about the MPT units. If you are working in Lat-Long, the Lat-Long values are presented in Lat-Long decimals.
Y – The North-South coordinate of the camera position represented in MPT units. You can use the ITerrain interface to retrieve information about the MPT units. If you are working in Lat-Long, the Lat-Long values are presented in Lat-Long decimals.
Height – The height of the camera, in meters.
Yaw – The Yaw angle of the plane. See: “Yaw, Pitch and Roll Angles”.
Pitch – The Pitch angle of the plane. See: “Yaw, Pitch and Roll Angles”.
Roll – The Roll angle of the plane. See: “Yaw, Pitch and Roll Angles”.
CameraDeltaYaw – The offset
between the plane yaw and the camera yaw.
See: “Camera and
Plane”.
CameraDeltaPitch – The
offset between the plane pitch and the camera pitch.
See: “Camera and
Plane”.
Flags – Determine how the X, Y, Height, Yaw, Pitch and Roll parameters are interpreted. If this parameter has a zero value, these parameters are indicated in absolute world coordinates. Alternatively, this flag can contain any combination of the following flags:
IGNORE_X = 1
The X parameter is ignored – In this case, the current X-coordinate
of the plane is not changed.
IGNORE_HEIGHT = 2
The Height parameter is ignored – In this case, the current Height
of the plane is not changed.
IGNORE_Y = 4
The Y parameter is ignored – In this case, the current Y-coordinate
of the plane is not changed.
IGNORE_POSITION = 7
This flag is a combination of IGNORE_X, IGNORE_HEIGHT and IGNORE_Y
and indicates that the position of the plane in the world is not
changed by this method call.
IGNORE_YAW = 8
The Yaw parameter is ignored – In this case, the current Yaw
orientation of the plane is not changed.
IGNORE_PITCH = 16
The Pitch parameter is ignored – In this case, the current Pitch
orientation of the plane is not changed.
IGNORE_ROLL = 32
The Roll parameter is ignored – In this case, the current Roll
orientation of the plane is not changed.
IGNORE_ORIENTATION = 56
This flag is a combination of IGNORE_YAW, IGNORE_PITCH, IGNORE_ROLL
and indicates that the orientation of the plane in the world is not
changed by this method call.
NEW_ELEVATION_RELATIVE_TO_CURRENT_ELEVATION = 64
When set, this flag indicates that the Height parameter should be
used as an offset from the current height of the plane.
NEW_POS_RELATIVE_TO_CURRENT_POS =
128
When set, this flag indicates that the X and Y parameters should be
used as an offset from the current plane position.
NEW_ANGLES_RELATIVE_TO_CURRENT_ANGLES = 256
When set, this flag indicates that the Yaw, Pitch and Roll
parameters should be used as an offset from the current plane
orientation.
IGNORE_CAMERA_YAW = 1024
The CameraDeltaYaw parameter is ignored – In this case, the current
CameraDeltaYaw offset of the camera is not changed.
IGNORE_CAMERA_PITCH =
2048
The CameraDeltaPitch parameter is ignored – In this case, the
current CameraDeltaPitch offset of the camera is not changed.
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. |