|
VR-Engage
2.2
|
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>
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 |
| vreRtd::DtVreRtdTerrainQueryHighFidelity::DtVreRtdTerrainQueryHighFidelity | ( | DtPhysicalWorld * | pw, |
| bool | blocking ) |
Constructor.
| pw | Pointer to the physical world instance to query against |
| blocking | Whether 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().
|
overridevirtual |
Destructor.
Cleans up resources used by the terrain query handler.
| vreRtd::DtVreRtdTerrainQueryHighFidelity::RTD_BASE_COMMON | ( | vreRtd | , |
| DtVreRtdTerrainQueryHighFidelity | ) |
Macro for common RTD type definitions.
References DtVreRtdTerrainQueryHighFidelity().
|
overridevirtual |
Performs a terrain query between two points.
| context | The query context (ground contact, sensor, etc.) |
| contextData | Additional context-specific data |
| userData | User-provided terrain query data |
| start | The start point of the query in world coordinates |
| end | The end point of the query in world coordinates |
| hitXYZ | Output parameter for the hit position |
| hitNormal | Output parameter for the surface normal at the hit position |
| hitVelocity | Output parameter for the velocity of the hit object (if moving) |
| frictionFactor | Output parameter for the surface friction factor |
| isLiquid | Output parameter indicating whether the hit surface is liquid |
| entity | Output parameter for the entity that was hit (if any) |
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.
|
protected |
Updates and checks the position cache for queries.
| isectRecord | Intersection record to populate |
| vehicleUuid | UUID of the vehicle performing the query |
| contextData | Additional context-specific data |
| coordSys | Coordinate system for the query |
| startPoint | Start point of the query in world coordinates |
| endPoint | End point of the query in world coordinates |
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.
|
protected |
Performs a terrain-only intersection test.
| isectRecord | Intersection record to populate |
| startPoint | Start point of the query in world coordinates |
| endPoint | End point of the query in world coordinates |
Checks for intersections with the terrain database between the specified points.
|
protected |
Performs a simulation object intersection test.
| isectRecord | Intersection record to populate |
| vehicleUuid | UUID of the vehicle performing the query |
| contextData | Additional context-specific data |
| startPoint | Start point of the query in world coordinates |
| endPoint | End point of the query in world coordinates |
Checks for intersections with simulation objects between the specified points.
|
protected |
Calculates hit details from an intersection record.
| isectRecord | Intersection record containing raw intersection data |
| coordSys | Coordinate system for the query |
| hitXYZ | Output parameter for the hit position |
| hitNormal | Output parameter for the surface normal at the hit position |
| hitVelocity | Output parameter for the velocity of the hit object |
Processes an intersection record to extract detailed hit information.
|
protected |
Handles the case where no terrain database is available.
| isectRecord | Intersection record to populate |
| coordSys | Coordinate system for the query |
| startLocal | Start point of the query in local coordinates |
| endLocal | End point of the query in local coordinates |
| hitXYZ | Output parameter for the hit position |
| hitNormal | Output parameter for the surface normal at the hit position |
| hitVelocity | Output parameter for the velocity of the hit object |
Provides a fallback intersection calculation when no terrain database is available, typically returning a flat ground plane intersection if appropriate.
|
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.