VR-Engage  2.2
Loading...
Searching...
No Matches
makVre::DtIntersector Class Referenceabstract

Detailed Description

DtIntersector provides an interface for performing various types of intersection tests within the 3D environment. This includes ray casting against terrain and entities, elevation queries, and screen-to-world coordinate conversion. These capabilities are essential for features like targeting, navigation, and object selection through clicking or pointing.

Concrete implementations of this interface are typically provided by display systems like OpenSceneGraph that have access to the full scene graph and can perform efficient intersection tests.

#include <intersector.h>

Inheritance diagram for makVre::DtIntersector:
[legend]

Public Member Functions

 DtIntersector ()
 
virtual ~DtIntersector ()
 
virtual bool elevationAt (DtVector point, double &result)=0
 
virtual bool terrainIntersectionAt (DtVector point, DtVector &result)=0
 
virtual bool getIntersection (DtVector start, DtVector end, DtVector &result, std::vector< makVrv::DtElementID > *ignoreId=0)=0
 
virtual bool getIntersection (DtVector start, DtTaitBryan ori, DtVector &result, std::vector< makVrv::DtElementID > *ignoreId=0)=0
 
virtual bool screenRayCast (float x, float y, DtVector &result)=0
 

Constructor & Destructor Documentation

◆ DtIntersector()

makVre::DtIntersector::DtIntersector ( )

Constructor.

Creates a new intersector instance with default values.

◆ ~DtIntersector()

virtual makVre::DtIntersector::~DtIntersector ( )
virtual

Virtual destructor.

Ensures proper cleanup of derived intersector classes.

Member Function Documentation

◆ elevationAt()

virtual bool makVre::DtIntersector::elevationAt ( DtVector point,
double & result )
pure virtual

Gets the elevation at a specific point.

Parameters
point3D position to query for elevation
resultOutput parameter to receive the elevation value
Returns
True if the elevation was successfully determined, false otherwise

Determines the terrain elevation at the specified horizontal position. The result is the height above mean sea level in meters. This is useful for determining the ground level for placement of objects.

Implemented in makVre::DtVrvIntersector.

◆ terrainIntersectionAt()

virtual bool makVre::DtIntersector::terrainIntersectionAt ( DtVector point,
DtVector & result )
pure virtual

Gets the terrain intersection point at a specific location.

Parameters
point3D position to project onto the terrain
resultOutput parameter to receive the intersection point
Returns
True if the intersection was successfully determined, false otherwise

Projects the given point onto the terrain surface along the vertical axis. The result is the 3D position on the terrain surface. This differs from elevationAt by returning a complete 3D point rather than just the height.

Implemented in makVre::DtVrvIntersector.

◆ getIntersection() [1/2]

virtual bool makVre::DtIntersector::getIntersection ( DtVector start,
DtVector end,
DtVector & result,
std::vector< makVrv::DtElementID > * ignoreId = 0 )
pure virtual

Performs a ray intersection test between two points.

Parameters
startStarting point of the ray
endEnding point of the ray
resultOutput parameter to receive the intersection point
ignoreIdOptional list of entity IDs to ignore in the test
Returns
True if an intersection was found, false otherwise

Tests for intersection of a finite ray from start to end with any objects in the scene. If an intersection is found, the result parameter is set to the intersection point. The optional ignoreId parameter allows specific entities to be excluded from the test.

Implemented in makVre::DtVrvIntersector.

◆ getIntersection() [2/2]

virtual bool makVre::DtIntersector::getIntersection ( DtVector start,
DtTaitBryan ori,
DtVector & result,
std::vector< makVrv::DtElementID > * ignoreId = 0 )
pure virtual

Performs a ray intersection test from a point in a direction.

Parameters
startStarting point of the ray
oriOrientation defining the ray direction
resultOutput parameter to receive the intersection point
ignoreIdOptional list of entity IDs to ignore in the test
Returns
True if an intersection was found, false otherwise

Tests for intersection of a ray starting at the specified point and extending in the direction defined by the orientation. If an intersection is found, the result parameter is set to the intersection point. The optional ignoreId parameter allows specific entities to be excluded from the test.

Implemented in makVre::DtVrvIntersector.

◆ screenRayCast()

virtual bool makVre::DtIntersector::screenRayCast ( float x,
float y,
DtVector & result )
pure virtual

Performs a ray cast from screen coordinates.

Parameters
xHorizontal screen coordinate (in pixels)
yVertical screen coordinate (in pixels)
resultOutput parameter to receive the intersection point
Returns
True if an intersection was found, false otherwise

Projects a ray from the camera through the specified screen coordinates and finds the first intersection with objects in the scene. This is typically used for mouse picking operations, converting a 2D screen click to a 3D position in the world.

Implemented in makVre::DtVrvIntersector.


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