|
VR-Engage
2.2
|
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>
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 |
| makVre::DtIntersector::DtIntersector | ( | ) |
Constructor.
Creates a new intersector instance with default values.
|
virtual |
Virtual destructor.
Ensures proper cleanup of derived intersector classes.
|
pure virtual |
Gets the elevation at a specific point.
| point | 3D position to query for elevation |
| result | Output parameter to receive the elevation value |
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.
|
pure virtual |
Gets the terrain intersection point at a specific location.
| point | 3D position to project onto the terrain |
| result | Output parameter to receive the intersection point |
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.
|
pure virtual |
Performs a ray intersection test between two points.
| start | Starting point of the ray |
| end | Ending point of the ray |
| result | Output parameter to receive the intersection point |
| ignoreId | Optional list of entity IDs to ignore in the test |
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.
|
pure virtual |
Performs a ray intersection test from a point in a direction.
| start | Starting point of the ray |
| ori | Orientation defining the ray direction |
| result | Output parameter to receive the intersection point |
| ignoreId | Optional list of entity IDs to ignore in the test |
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.
|
pure virtual |
Performs a ray cast from screen coordinates.
| x | Horizontal screen coordinate (in pixels) |
| y | Vertical screen coordinate (in pixels) |
| result | Output parameter to receive the intersection point |
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.