![]() |
VR-Forces 4.6.1 Class Documentation
|
DtTerrainInterface provides a set of intersection methods you can use to query the terrain database, using 3D chords to define the segment and direction of interest for intersections.
You can ask:
Additionally, for a given intersection query you can specify what kinds of information you want to receive:
For example, to query the terrain interface for the intersection with the terrain surface, returning the location of the intersection only, do the following:
You can use the intersectionTime parameter returned in the intersect() method to determine where along the chord the intersection with the terrain occurred. Values for intersection time t, given a chord(p1, p2) indicate the following:
In the figure, a call to intersect() with chord (P0, P1) intersects the terrain at point Q. The method will return TRUE, because point Q lies along the chord, and the intersection time at Q will be a value between 0 and 1. The intersection time at point R (which lies on an extension of the chord) has an intersection time > 1.
To get more information about the intersection point, you can call a variant of intersect() that returns a DtChordIntersectionRecord (chrdIntRec.h), instead of just the DtPoint. The DtChordIntersectionRecord can return information such as the location of the intersection, surface type, normal vector of the terrain at that point, and the polygon intersected. For example, to make an intersection test (similar to the previous example), requesting the intersection point and normal, do the following:
[<< Using the DtTerrainInterface Class] [Home] [Top of Page] [Using Vector Networks >>]