- All Implemented Interfaces:
It basically works by casting a pick ray against the bounding volumes of the TerrainQuad and its children, gathering all of the TerrainPatches hit (in distance order.) The triangles of each patch are then tested using the BresenhamYUpGridTracer to determine which triangles to test and in what order. When a hit is found, it is guaranteed to be the first such hit and can immediately be returned.
Method SummaryModifier and TypeMethodDescription
(float gridX, float gridY, Ray pick, Vector3f intersection, TerrainPatch patch, Triangle store)
protected intFinds the closest height point to a position.
intAsk for the point of intersection between the given ray and the terrain.
protected booleanRequest the triangles (in world coord space) of a TerrainBlock that correspond to the given grid location.
setSupportMultipleCollisionspublic void setSupportMultipleCollisions
isSupportingMultipleCollisionspublic boolean isSupportingMultipleCollisions()
getTerrainIntersectionDescription copied from interface:
TerrainPickerAsk for the point of intersection between the given ray and the terrain.
getTrianglesprotected boolean getTriangles
(float gridX, float gridY, TerrainPatch patch)Request the triangles (in world coord space) of a TerrainBlock that correspond to the given grid location. The triangles are stored in the class fields _gridTriA and _gridTriB.
gridX- grid row
gridY- grid column
patch- the TerrainPatch we are working with
- true if the grid point is valid for the given block, false if it is off the block.
findClosestHeightIndexFinds the closest height point to a position. Will always be left/above that position.
position- the position to check at
patch- the patch to get height values from
- an index to the height position of the given block.