17#include <vrvCore/DtDisplayUnitsSettingsManager.h>
23#include <matrix/vlVector.h>
24#include <matrix/topoCoord.h>
55#pragma warning (disable:4505)
61 ss << altitudeIn10kFeet;
65static void split(
const std::string& str,
char delimeter, std::vector<std::string>& tokens)
67 std::stringstream ss(str);
69 while (std::getline(ss, item, delimeter))
71 tokens.push_back(item);
78 ss << std::fixed << std::setprecision(decimalPrecision) << num;
84static double closingSpeed(
const DtVector& p1,
const DtVector& p2,
const DtVector32& v1,
const DtVector32& v2)
86 DtVector positionDifference = p1 - p2;
87 DtVector velocityDifference = DtVector32To64(v1 - v2);
88 return -((velocityDifference).dotProduct(positionDifference)/sqrt(positionDifference.magnitudeSquared()));
91static double headingAngleTo(
const DtVector& geocentricObserverPosition,
const DtVector& geocentricTargetPosition)
93 DtGeodeticCoord geodeticObserverPosition;
94 geodeticObserverPosition.setGeocentric(geocentricObserverPosition);
97 DtLatLon_to_GeocToTopo(geodeticObserverPosition, geocToTopo);
100 DtVector observerToTarget = geocentricTargetPosition -
101 geocentricObserverPosition;
104 DtDcmVecMul(geocToTopo, observerToTarget, observerToTarget);
109 double heading = atan2(observerToTarget[DtY], observerToTarget[DtX]);
113 makArchives::DtDisplayUnitsSettingsRecord::NorthUnits northUnits = converter.currentNorthUnit(
114 makVrv::DtSharedDisplayUnitsSettings::theApplicationDisplayUnitCollectionName,
115 makVrv::DtSharedDisplayUnitsSettings::theHeadingDisplayUnitName);
117 return DtModPerLo(converter.convertHeadingUnitNativeToDisplay(geocentricObserverPosition, heading, northUnits), 0, 360);
121static float entityHeading(
const DtVector& worldPosition,
const DtTaitBryan& worldOrientnation)
123 return DtModPerLo(
radToDeg(DtGetHeadingFromGeocentric(worldPosition, worldOrientnation)), 0, 360);
static DtPlayerStationApp * instance()
Gets the singleton instance of this class.
static double headingAngleTo(const DtVector &geocentricObserverPosition, const DtVector &geocentricTargetPosition)
Definition fsUtil.h:91
static float entityHeading(const DtVector &worldPosition, const DtTaitBryan &worldOrientnation)
Returns the heading of an entity according to its world position and orientation.
Definition fsUtil.h:121
T maximum(T x, T y)
Returns what ever is greater, x or y of type T.
Definition fsUtil.h:130
float metersPerSecondToKnots(float value)
Definition fsUtil.h:52
static const float degToRadValue
Definition fsUtil.h:30
static const int radarContactElements
Definition fsUtil.h:41
static const float radToDegValue
Contains constants and utility functions used in Fixed Wing and Rotary Wing GLS projects.
Definition fsUtil.h:29
static std::string numberToString(double num, int decimalPrecision)
Definition fsUtil.h:75
static std::string metersTo10kFeetText(float value)
Definition fsUtil.h:57
static const float metersToNauticalMilesValue
Definition fsUtil.h:36
float feetToMeters(float value)
Definition fsUtil.h:47
T minimum(T x, T y)
Returns the which ever is lesser, x or y of type T.
Definition fsUtil.h:137
float radToDeg(float value)
Definition fsUtil.h:43
float metersToNauticalMiles(float value)
Definition fsUtil.h:50
float nauticalMilesToMeters(float value)
Definition fsUtil.h:49
float degToRad(float value)
Definition fsUtil.h:44
static void split(const std::string &str, char delimeter, std::vector< std::string > &tokens)
Definition fsUtil.h:65
static double closingSpeed(const DtVector &p1, const DtVector &p2, const DtVector32 &v1, const DtVector32 &v2)
Calculate the closing speed of two objects by their position and velocity vectors....
Definition fsUtil.h:84
static const float metersPerSecondToKnotsValue
Definition fsUtil.h:38
static const float feetToMetersValue
Definition fsUtil.h:33
static const float metersToFeetValue
Definition fsUtil.h:32
static const float nauticalMilesToMetersValue
Definition fsUtil.h:35
float metersToFeet(float value)
Definition fsUtil.h:46
Defines the DtPlayerStationApp class for the VR-Engage application.
makVrv::DtDe * de()
Gets the display element pointer used by the plugin.