|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme3.terrain.geomipmap.picking.BresenhamTerrainPicker
public class BresenhamTerrainPicker
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.
Constructor Summary | |
---|---|
BresenhamTerrainPicker(TerrainQuad root)
|
Method Summary | |
---|---|
protected boolean |
checkTriangles(float gridX,
float gridY,
Ray pick,
Vector3f intersection,
TerrainPatch patch,
Triangle store)
|
protected int |
findClosestHeightIndex(Vector3f position,
TerrainPatch patch)
Finds the closest height point to a position. |
Vector3f |
getTerrainIntersection(Ray worldPick,
CollisionResults results)
Ask for the point of intersection between the given ray and the terrain. |
protected 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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BresenhamTerrainPicker(TerrainQuad root)
Method Detail |
---|
public Vector3f getTerrainIntersection(Ray worldPick, CollisionResults results)
TerrainPicker
getTerrainIntersection
in interface TerrainPicker
worldPick
- our pick ray, in world space.
protected boolean checkTriangles(float gridX, float gridY, Ray pick, Vector3f intersection, TerrainPatch patch, Triangle store)
protected boolean getTriangles(float gridX, float gridY, TerrainPatch patch)
gridX
- grid rowgridY
- grid columnblock
- the TerrainBlock we are working with
protected int findClosestHeightIndex(Vector3f position, TerrainPatch patch)
position
- the position to check atblock
- the block to get height values from
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |