VR-Engage  2.2
Loading...
Searching...
No Matches
vreRtd::DtVreRtdTerrainQueryHighFidelity Class Reference

Detailed Description

This class provides high-fidelity terrain and object intersection queries for the VREngage Real-Time Dynamics system. It detects collisions with terrain and simulation objects, and provides detailed information about hits including position, normal vectors, velocity, and surface properties like friction. This is used primarily for ground contact detection in flight models.

#include <vreRtdTerrainQueryHighFidelity.h>

Inheritance diagram for vreRtd::DtVreRtdTerrainQueryHighFidelity:
[legend]

Public Member Functions

 RTD_BASE_COMMON (vreRtd, DtVreRtdTerrainQueryHighFidelity)
 
 DtVreRtdTerrainQueryHighFidelity (DtPhysicalWorld *pw, bool blocking)
 
virtual ~DtVreRtdTerrainQueryHighFidelity () override
 
virtual bool query (QueryContext context, const void *contextData, const RTD::TerrainQueryUserData *userData, const smVec3d &start, const smVec3d &end, smVec3d &hitXYZ, smVec3d &hitNormal, smVec3d &hitVelocity, smReal &frictionFactor, bool &isLiquid, const RTD::EntityBase *&entity) override
 
- Public Member Functions inherited from vreRtd::DtVreRtdTraitTerrainQuery
 DtVreRtdTraitTerrainQuery ()
 
virtual ~DtVreRtdTraitTerrainQuery ()
 
void setCheckTerrain (bool status)
 

Protected Member Functions

bool updateAndCheckPositionCache (DtVrfChordIntersectionRecord &isectRecord, DtUUID &vehicleUuid, const void *contextData, Coordinate_System *coordSys, DtPoint startPoint, DtPoint endPoint)
 
bool terrainIntersect (DtVrfChordIntersectionRecord &isectRecord, DtPoint startPoint, DtPoint endPoint)
 
bool simObjectIntersect (DtVrfChordIntersectionRecord &isectRecord, DtUUID &vehicleUuid, const void *contextData, DtPoint startPoint, DtPoint endPoint)
 
bool calculateHit (DtVrfChordIntersectionRecord &isectRecord, Coordinate_System *coordSys, smVec3d &hitXYZ, smVec3d &hitNormal, smVec3d &hitVelocity)
 
bool noTerrainDBIntersect (DtVrfChordIntersectionRecord &isectRecord, Coordinate_System *coordSys, DtVector startLocal, DtVector endLocal, smVec3d &hitXYZ, smVec3d &hitNormal, smVec3d &hitVelocity)
 

Protected Attributes

bool myIsBlocking
 
- Protected Attributes inherited from vreRtd::DtVreRtdTraitTerrainQuery
DtPhysicalWorld * myPhysicalWorld
 
bool myCheckTerrain
 

Constructor & Destructor Documentation

◆ DtVreRtdTerrainQueryHighFidelity()

vreRtd::DtVreRtdTerrainQueryHighFidelity::DtVreRtdTerrainQueryHighFidelity ( DtPhysicalWorld * pw,
bool blocking )

Constructor.

Parameters
pwPointer to the physical world instance to query against
blockingWhether terrain queries should block until completed

Initializes a new high-fidelity terrain query handler with the specified physical world and blocking behavior.

Referenced by RTD_BASE_COMMON().

◆ ~DtVreRtdTerrainQueryHighFidelity()

virtual vreRtd::DtVreRtdTerrainQueryHighFidelity::~DtVreRtdTerrainQueryHighFidelity ( )
overridevirtual

Destructor.

Cleans up resources used by the terrain query handler.

Member Function Documentation

◆ RTD_BASE_COMMON()

vreRtd::DtVreRtdTerrainQueryHighFidelity::RTD_BASE_COMMON ( vreRtd ,
DtVreRtdTerrainQueryHighFidelity  )

Macro for common RTD type definitions.

References DtVreRtdTerrainQueryHighFidelity().

◆ query()

virtual bool vreRtd::DtVreRtdTerrainQueryHighFidelity::query ( QueryContext context,
const void * contextData,
const RTD::TerrainQueryUserData * userData,
const smVec3d & start,
const smVec3d & end,
smVec3d & hitXYZ,
smVec3d & hitNormal,
smVec3d & hitVelocity,
smReal & frictionFactor,
bool & isLiquid,
const RTD::EntityBase *& entity )
overridevirtual

Performs a terrain query between two points.

Parameters
contextThe query context (ground contact, sensor, etc.)
contextDataAdditional context-specific data
userDataUser-provided terrain query data
startThe start point of the query in world coordinates
endThe end point of the query in world coordinates
hitXYZOutput parameter for the hit position
hitNormalOutput parameter for the surface normal at the hit position
hitVelocityOutput parameter for the velocity of the hit object (if moving)
frictionFactorOutput parameter for the surface friction factor
isLiquidOutput parameter indicating whether the hit surface is liquid
entityOutput parameter for the entity that was hit (if any)
Returns
True if an intersection was found, false otherwise

Performs a high-fidelity terrain query between the specified start and end points, checking for intersections with both terrain and simulation objects. If an intersection is found, the output parameters are populated with the hit details.

◆ updateAndCheckPositionCache()

bool vreRtd::DtVreRtdTerrainQueryHighFidelity::updateAndCheckPositionCache ( DtVrfChordIntersectionRecord & isectRecord,
DtUUID & vehicleUuid,
const void * contextData,
Coordinate_System * coordSys,
DtPoint startPoint,
DtPoint endPoint )
protected

Updates and checks the position cache for queries.

Parameters
isectRecordIntersection record to populate
vehicleUuidUUID of the vehicle performing the query
contextDataAdditional context-specific data
coordSysCoordinate system for the query
startPointStart point of the query in world coordinates
endPointEnd point of the query in world coordinates
Returns
True if the cache was updated, false otherwise

Updates the internal position cache and checks if it contains valid data for the current query, which can be used to optimize repeated queries in similar locations.

◆ terrainIntersect()

bool vreRtd::DtVreRtdTerrainQueryHighFidelity::terrainIntersect ( DtVrfChordIntersectionRecord & isectRecord,
DtPoint startPoint,
DtPoint endPoint )
protected

Performs a terrain-only intersection test.

Parameters
isectRecordIntersection record to populate
startPointStart point of the query in world coordinates
endPointEnd point of the query in world coordinates
Returns
True if a terrain intersection was found, false otherwise

Checks for intersections with the terrain database between the specified points.

◆ simObjectIntersect()

bool vreRtd::DtVreRtdTerrainQueryHighFidelity::simObjectIntersect ( DtVrfChordIntersectionRecord & isectRecord,
DtUUID & vehicleUuid,
const void * contextData,
DtPoint startPoint,
DtPoint endPoint )
protected

Performs a simulation object intersection test.

Parameters
isectRecordIntersection record to populate
vehicleUuidUUID of the vehicle performing the query
contextDataAdditional context-specific data
startPointStart point of the query in world coordinates
endPointEnd point of the query in world coordinates
Returns
True if a simulation object intersection was found, false otherwise

Checks for intersections with simulation objects between the specified points.

◆ calculateHit()

bool vreRtd::DtVreRtdTerrainQueryHighFidelity::calculateHit ( DtVrfChordIntersectionRecord & isectRecord,
Coordinate_System * coordSys,
smVec3d & hitXYZ,
smVec3d & hitNormal,
smVec3d & hitVelocity )
protected

Calculates hit details from an intersection record.

Parameters
isectRecordIntersection record containing raw intersection data
coordSysCoordinate system for the query
hitXYZOutput parameter for the hit position
hitNormalOutput parameter for the surface normal at the hit position
hitVelocityOutput parameter for the velocity of the hit object
Returns
True if hit details were successfully calculated, false otherwise

Processes an intersection record to extract detailed hit information.

◆ noTerrainDBIntersect()

bool vreRtd::DtVreRtdTerrainQueryHighFidelity::noTerrainDBIntersect ( DtVrfChordIntersectionRecord & isectRecord,
Coordinate_System * coordSys,
DtVector startLocal,
DtVector endLocal,
smVec3d & hitXYZ,
smVec3d & hitNormal,
smVec3d & hitVelocity )
protected

Handles the case where no terrain database is available.

Parameters
isectRecordIntersection record to populate
coordSysCoordinate system for the query
startLocalStart point of the query in local coordinates
endLocalEnd point of the query in local coordinates
hitXYZOutput parameter for the hit position
hitNormalOutput parameter for the surface normal at the hit position
hitVelocityOutput parameter for the velocity of the hit object
Returns
True if a fallback intersection was calculated, false otherwise

Provides a fallback intersection calculation when no terrain database is available, typically returning a flat ground plane intersection if appropriate.

Member Data Documentation

◆ myIsBlocking

bool vreRtd::DtVreRtdTerrainQueryHighFidelity::myIsBlocking
protected

Flag indicating whether terrain queries are blocking.

When true, terrain queries will block until completed. When false, they will return immediately, potentially with cached or approximate results.


The documentation for this class was generated from the following file: