VR-Engage  2.2
Loading...
Searching...
No Matches
fsUtil.h File Reference
Include dependency graph for fsUtil.h:

Go to the source code of this file.

Functions

float radToDeg (float value)
 
float degToRad (float value)
 
float metersToFeet (float value)
 
float feetToMeters (float value)
 
float nauticalMilesToMeters (float value)
 
float metersToNauticalMiles (float value)
 
float metersPerSecondToKnots (float value)
 
static std::string metersTo10kFeetText (float value)
 
static void split (const std::string &str, char delimeter, std::vector< std::string > &tokens)
 
static std::string numberToString (double num, int decimalPrecision)
 
static double closingSpeed (const DtVector &p1, const DtVector &p2, const DtVector32 &v1, const DtVector32 &v2)
 
static double headingAngleTo (const DtVector &geocentricObserverPosition, const DtVector &geocentricTargetPosition)
 
static float entityHeading (const DtVector &worldPosition, const DtTaitBryan &worldOrientnation)
 
template<typename T>
maximum (T x, T y)
 
template<typename T>
minimum (T x, T y)
 

Variables

static const float radToDegValue = 57.2958f
 
static const float degToRadValue = 1.0f / radToDegValue
 
static const float metersToFeetValue = 3.28084f
 
static const float feetToMetersValue = 1.0f / metersToFeetValue
 
static const float nauticalMilesToMetersValue = 1852.0f
 
static const float metersToNauticalMilesValue = 1.0f / nauticalMilesToMetersValue
 
static const float metersPerSecondToKnotsValue = 3600.0f / nauticalMilesToMetersValue
 
static const int radarContactElements = 8
 

Detailed Description

This file provides constants and inline functions for common unit conversions used in fixed-wing and rotary-wing GL Studio cockpit projects. Includes conversions between metric and imperial units for altitude, speed, and distance.

Function Documentation

◆ radToDeg()

float radToDeg ( float value)
inline

References radToDegValue.

Referenced by entityHeading().

◆ degToRad()

float degToRad ( float value)
inline

References degToRadValue.

◆ metersToFeet()

float metersToFeet ( float value)
inline

References metersToFeetValue.

Referenced by metersTo10kFeetText().

◆ feetToMeters()

float feetToMeters ( float value)
inline

References feetToMetersValue.

◆ nauticalMilesToMeters()

float nauticalMilesToMeters ( float value)
inline

◆ metersToNauticalMiles()

float metersToNauticalMiles ( float value)
inline

◆ metersPerSecondToKnots()

float metersPerSecondToKnots ( float value)
inline

◆ metersTo10kFeetText()

static std::string metersTo10kFeetText ( float value)
static

References metersToFeet().

◆ split()

static void split ( const std::string & str,
char delimeter,
std::vector< std::string > & tokens )
static

◆ numberToString()

static std::string numberToString ( double num,
int decimalPrecision )
static

◆ closingSpeed()

static double closingSpeed ( const DtVector & p1,
const DtVector & p2,
const DtVector32 & v1,
const DtVector32 & v2 )
static

Calculate the closing speed of two objects by their position and velocity vectors. C = -((v1-v2)•(p1-p2)/|p1-p2|)

◆ headingAngleTo()

static double headingAngleTo ( const DtVector & geocentricObserverPosition,
const DtVector & geocentricTargetPosition )
static

◆ entityHeading()

static float entityHeading ( const DtVector & worldPosition,
const DtTaitBryan & worldOrientnation )
static

Returns the heading of an entity according to its world position and orientation.

References radToDeg().

◆ maximum()

template<typename T>
T maximum ( T x,
T y )

Returns what ever is greater, x or y of type T.

Referenced by makVre::MiniPID::setMaxIOutput(), and makVre::MiniPID::setOutputLimits().

◆ minimum()

template<typename T>
T minimum ( T x,
T y )

Returns the which ever is lesser, x or y of type T.

Referenced by makVre::MiniPID::setOutputLimits().

Variable Documentation

◆ radToDegValue

const float radToDegValue = 57.2958f
static

Contains constants and utility functions used in Fixed Wing and Rotary Wing GLS projects.

Referenced by radToDeg().

◆ degToRadValue

const float degToRadValue = 1.0f / radToDegValue
static

Referenced by degToRad().

◆ metersToFeetValue

const float metersToFeetValue = 3.28084f
static

Referenced by metersToFeet().

◆ feetToMetersValue

const float feetToMetersValue = 1.0f / metersToFeetValue
static

Referenced by feetToMeters().

◆ nauticalMilesToMetersValue

const float nauticalMilesToMetersValue = 1852.0f
static

Referenced by nauticalMilesToMeters().

◆ metersToNauticalMilesValue

const float metersToNauticalMilesValue = 1.0f / nauticalMilesToMetersValue
static

Referenced by metersToNauticalMiles().

◆ metersPerSecondToKnotsValue

const float metersPerSecondToKnotsValue = 3600.0f / nauticalMilesToMetersValue
static

Referenced by metersPerSecondToKnots().

◆ radarContactElements

const int radarContactElements = 8
static