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

Go to the source code of this file.

Namespaces

namespace  vreRtd
 
namespace  RTD
 
namespace  FixedWingLibCGF
 
namespace  RotorLibCGF
 

Macros

#define GEODETIC_TO_LOCAL(geo, local)
 
#define LOCAL_TO_GEODETIC(local, geo)
 
#define VRF_OBJECT_GET_NAME   objectName
 
#define GET_EXT_ENTITY_NAME(entity)
 
#define GET_EXT_VRF_OBJ_NAME(object)
 
#define RTDHeadingToVrfHeading(hdgInDeg)
 
#define VrfHeadingToRTDHeading(hdgInDeg)
 
#define toDtVector(v)
 
#define toSmVec3r(v)
 
#define toSmVec2r(v)
 
#define toSmVec3d(v)
 
#define toSmVec2d(v)
 
#define toRTDLLA(geodeticCoord)
 
#define toRTDLL(geodeticCoord)
 
#define toGeodetic(lla)
 
#define RTD_CHECK_CONSWARN_RETURN(expression, complaint)
 
#define RTD_CHECK_DTWARN_RETURN(expression, complaint)
 
#define RTD_CHECK_CONSWARN_RETURN2(expression, complaint, retVal)
 
#define RTD_CHECK_DTWARN_RETURN2(expression, complaint, retVal)
 

Functions

 RTDVRFConfigWarnsForExternalIncludes () class DtVrfObjectStateRepository
 
void vreRtd::setDeadreckoningThresholds (DtLocalObject *entity, double transThreshold, double rotationThreshold)
 
smVec3r vreRtd::VRFOriToRTDHPR (const DtTaitBryan &ori)
 
DtTaitBryan vreRtd::HprToVRFOri (const smVec3r &hpr)
 
smVec3r vreRtd::VRFWorldOriToRTDWorldHPR (const DtTaitBryan &ori)
 
DtTaitBryan vreRtd::RTDWorldHprToVRFWorldOri (const smVec3r &hpr)
 
smVec3r vreRtd::VRFRotVelToRTDRotVelWCS (const DtTaitBryan &entityWorldOrientation, const DtVector &rotationalVelocity)
 
DtVector vreRtd::RTDRotVelWCSToVRFRotVel (const DtTaitBryan &entityWorldOrientation, const smVec3r &rotationalVelocity)
 
DtTaitBryan vreRtd::TopoToLocalWrtDatabase (DtPhysicalWorld *physicalWorld, const DtVector &localPosition, const DtTaitBryan &topographicOrientation)
 
DtVector vreRtd::TopoToLocalWrtDatabase (DtPhysicalWorld *physicalWorld, const DtVector &localPosition, const DtVector &vec)
 
DtTaitBryan vreRtd::LocalWrtDatabaseToTopo (DtPhysicalWorld *physicalWorld, const DtVector &localPosition, const DtTaitBryan &localOrientation)
 
smReal vreRtd::compute2DDist (const smVec3r &pnt1, const DtVector &pnt2)
 
smVec3r vreRtd::getHeadingAlignedSpeedVector (const smVec3r &hpr, smReal speed, bool xyOnly=false)
 
smVec3r vreRtd::getHeadingAlignedSpeedVector (FixedWingLibCGF::AirplaneBot *bot, smReal speed, bool xyOnly=false)
 
DtVector vreRtd::getVecMatchingDirection (DtPhysicalWorld *physicalWorld, DtVrfObjectStateRepository *sr, DtReal vecMagnitude)
 
void vreRtd::applyAltitudeLimit (RTD::VehicleBase *vehicle, const smReal &maxAltitude)
 
void vreRtd::applySpeedLimit (RTD::VehicleBase *vehicle, const smReal &maxSpeed)
 
void vreRtd::applyWind (DtPhysicalWorld *physicalWorld, RTD::VehicleBase *vehicle)
 
void vreRtd::applyWind (RTD::VehicleBase *vehicle, double vrfWindDir, double vrfWindSpeed)
 
bool vreRtd::computeTerrainHeight (const DtSimulationServices *simMan, const DtVector &localPosition, double &result)
 
double vreRtd::getTerrainHeight (const DtSimulationServices *simMan, const DtVector &localPosition)
 
double vreRtd::getHAT (const DtSimulationServices *simMan, const DtGeodeticCoord &pos)
 

Detailed Description

This file provides common utility functions and macros for coordinate transformations, terrain queries, and other operations used by the VREngage Real-Time Dynamics (RTD) components. It includes conversions between VRF (Virtual Reality Forces) and RTD coordinate systems, orientation transformations, terrain height calculation, and vehicle property modifiers such as wind, speed limits, and altitude limits.

Macro Definition Documentation

◆ GEODETIC_TO_LOCAL

#define GEODETIC_TO_LOCAL ( geo,
local )
Value:
simulationServices()->physicalWorld()->geodeticToDatabase((geo), (local))

Macro to convert geodetic coordinates to local database coordinates.

Parameters
geoThe geodetic coordinates to convert
localThe resulting local database coordinates

Converts geodetic coordinates (latitude, longitude, altitude) to local database coordinates using the simulation's physical world.

◆ LOCAL_TO_GEODETIC

#define LOCAL_TO_GEODETIC ( local,
geo )
Value:
simulationServices()->physicalWorld()->databaseToGeodetic((local), (geo));

Macro to convert local database coordinates to geodetic coordinates.

Parameters
localThe local database coordinates to convert
geoThe resulting geodetic coordinates

Converts local database coordinates to geodetic coordinates (latitude, longitude, altitude) using the simulation's physical world.

◆ VRF_OBJECT_GET_NAME

#define VRF_OBJECT_GET_NAME   objectName

Version-dependent macro for accessing object name properties.

This macro provides version compatibility between different VRF plugin versions. In version 4.4.0 and later, we use markingText, while in earlier versions we use objectName.

◆ GET_EXT_ENTITY_NAME

#define GET_EXT_ENTITY_NAME ( entity)
Value:
("'" + (entity)->getMarkingText() + "'" + " (" + (entity)->getName() + ')')

Macro to get a formatted name for an external entity.

Parameters
entityPointer to the entity object
Returns
A string containing the marking text and name of the entity

Creates a formatted display name for an external entity that includes both the marking text (in single quotes) and the entity name (in parentheses).

◆ GET_EXT_VRF_OBJ_NAME

#define GET_EXT_VRF_OBJ_NAME ( object)
Value:
("'" + (object)->markingText().stdString() + "'" + " (" + (object)->uuid().uuidString().stdString() + ')')

Macro to get a formatted name for a VRF object.

Parameters
objectPointer to the VRF object
Returns
A string containing the marking text and UUID of the object

Creates a formatted display name for a VRF object that includes both the marking text (in single quotes) and the object's UUID (in parentheses).

◆ RTDHeadingToVrfHeading

#define RTDHeadingToVrfHeading ( hdgInDeg)
Value:
(-hdgInDeg)

Macro to convert an RTD heading to a VRF heading.

Parameters
hdgInDegRTD heading in degrees
Returns
VRF heading in degrees

Converts a heading from RTD coordinate system to VRF coordinate system. In VRF, heading increases clockwise from north, while in RTD, heading increases counterclockwise from north.

◆ VrfHeadingToRTDHeading

#define VrfHeadingToRTDHeading ( hdgInDeg)
Value:
(-hdgInDeg)

Macro to convert a VRF heading to an RTD heading.

Parameters
hdgInDegVRF heading in degrees
Returns
RTD heading in degrees

Converts a heading from VRF coordinate system to RTD coordinate system. In VRF, heading increases clockwise from north, while in RTD, heading increases counterclockwise from north.

◆ toDtVector

#define toDtVector ( v)
Value:
DtVector((v)[0], (v)[1], (v)[2])

Macro to convert a vector to DtVector.

Parameters
vVector to convert
Returns
Equivalent DtVector

◆ toSmVec3r

#define toSmVec3r ( v)
Value:
smVec3r((v)[0], (v)[1], (v)[2])

Macro to convert a vector to smVec3r (single precision 3D vector)

Parameters
vVector to convert
Returns
Equivalent smVec3r

◆ toSmVec2r

#define toSmVec2r ( v)
Value:
smVec2r((v)[0], (v)[1])

Macro to convert a vector to smVec2r (single precision 2D vector)

Parameters
vVector to convert
Returns
Equivalent smVec2r

◆ toSmVec3d

#define toSmVec3d ( v)
Value:
smVec3d((v)[0], (v)[1], (v)[2])

Macro to convert a vector to smVec3d (double precision 3D vector)

Parameters
vVector to convert
Returns
Equivalent smVec3d

◆ toSmVec2d

#define toSmVec2d ( v)
Value:
smVec2d((v)[0], (v)[1])

Macro to convert a vector to smVec2d (double precision 2D vector)

Parameters
vVector to convert
Returns
Equivalent smVec2d

◆ toRTDLLA

#define toRTDLLA ( geodeticCoord)
Value:
smVec3r(smMath::radToDeg(geodeticCoord[0]), smMath::radToDeg(geodeticCoord[1]), geodeticCoord[2])

Macro to convert a geodetic coordinate to RTD LLA (Latitude, Longitude, Altitude)

Parameters
geodeticCoordGeodetic coordinate in radians with altitude in meters
Returns
RTD LLA with latitude and longitude in degrees, altitude in meters

◆ toRTDLL

#define toRTDLL ( geodeticCoord)
Value:
smVec2r(smMath::radToDeg(geodeticCoord[0]), smMath::radToDeg(geodeticCoord[1]))

Macro to convert a geodetic coordinate to RTD LL (Latitude, Longitude)

Parameters
geodeticCoordGeodetic coordinate in radians
Returns
RTD LL with latitude and longitude in degrees

◆ toGeodetic

#define toGeodetic ( lla)
Value:
DtGeodeticCoord(smMath::degToRad(lla[0]), smMath::degToRad(lla[1]), lla[2])

Macro to convert an RTD LLA to geodetic coordinate.

Parameters
llaRTD LLA with latitude and longitude in degrees, altitude in meters
Returns
Geodetic coordinate in radians with altitude in meters

◆ RTD_CHECK_CONSWARN_RETURN

#define RTD_CHECK_CONSWARN_RETURN ( expression,
complaint )
Value:
if (!(expression)) \
{ \
objectConsoleWarn() << (complaint) << std::endl; \
return; \
}

Macro to check an expression and return if false, logging a console warning.

Parameters
expressionThe expression to check
complaintThe message to log if the expression is false

Evaluates the given expression and, if false, logs a warning to the object console and returns from the current function (with no return value).

◆ RTD_CHECK_DTWARN_RETURN

#define RTD_CHECK_DTWARN_RETURN ( expression,
complaint )
Value:
if (!(expression)) \
{ \
DtWarn(complaint "\n"); \
return; \
}

Macro to check an expression and return if false, logging a DtWarn.

Parameters
expressionThe expression to check
complaintThe message to log if the expression is false

Evaluates the given expression and, if false, logs a warning using DtWarn and returns from the current function (with no return value).

◆ RTD_CHECK_CONSWARN_RETURN2

#define RTD_CHECK_CONSWARN_RETURN2 ( expression,
complaint,
retVal )
Value:
if (!(expression)) \
{ \
objectConsoleWarn() << (complaint) << std::endl; \
return retVal; \
}

Macro to check an expression and return a value if false, logging a console warning.

Parameters
expressionThe expression to check
complaintThe message to log if the expression is false
retValThe value to return if the expression is false

Evaluates the given expression and, if false, logs a warning to the object console and returns the specified value from the current function.

◆ RTD_CHECK_DTWARN_RETURN2

#define RTD_CHECK_DTWARN_RETURN2 ( expression,
complaint,
retVal )
Value:
if (!(expression)) \
{ \
DtWarn(complaint "\n"); \
return retVal; \
}

Macro to check an expression and return a value if false, logging a DtWarn.

Parameters
expressionThe expression to check
complaintThe message to log if the expression is false
retValThe value to return if the expression is false

Evaluates the given expression and, if false, logs a warning using DtWarn and returns the specified value from the current function.

Function Documentation

◆ RTDVRFConfigWarnsForExternalIncludes()

RTDVRFConfigWarnsForExternalIncludes ( )