generatePositionAndOrientationHPR method
- Coordinates targetCoords,
- Point3d headingPitchRollDeg
Generate a position at longitude, latitude in degrees, with respect to surface of focused sphere, altitude in meters above sphere (sea level), oriented toward the specified heading, pitch and roll.
The heading is 0 deg=North with respect to the focused sphere, 90 deg=East, 180 deg=South, 270 deg or -90 deg=west.
Pitch is 0 deg=the object (or camera) forward vector looking toward the center of the focused sphere, 90 deg=looking at horizon.
Roll is a rotation about the forward vector, positive deg to the left and negative deg to the right.
The camera position and orientation are unchanged. The camera or any other object can then be set at the resulting position and with the resulting orientation.
Parameters
- IN targetCoords Coordinates representing the desired latitude, longitude and altitude.
- IN headingPitchRollDeg Point3d representing the desired heading, pitch and roll.
Returns
- GemError.success on success, otherwise see GemError for other values.
- The computed position and orientation.
Throws
- An exception if it fails.
Implementation
Pair<GemError, PositionOrientation> generatePositionAndOrientationHPR(
final Coordinates targetCoords,
final Point3d headingPitchRollDeg,
) {
final OperationResult resultString = objectMethod(
_pointerId,
'MapCamera',
'generatePositionAndOrientation',
args: <String, Object>{
'coordinates': targetCoords,
'tuple3D': headingPitchRollDeg,
},
);
return Pair<GemError, PositionOrientation>(
GemErrorExtension.fromCode(resultString['result']['errorCode']),
PositionOrientation(
position: Point3d.fromJson(resultString['result']['tuple3D']),
orientation: Point4d.fromJson(resultString['result']['tuple4D']),
),
);
}