|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jmex.terrain.util.BresenhamTerrainPicker
public class BresenhamTerrainPicker
Utility class for doing ray based picking of TerrainPages using the
BresenhamYUpGridTracer
. It basically works by casting a pick ray
against the bounding volumes of the TerrainPage and its children, gathering
all of the TerrainBlocks hit (in distance order.) The triangles of each block
are then tested using the BresenhamYUpGridTracer to determine which triangles
to test and in what order. When a hit is found, it is guarenteed to be the
first such hit and can immediately be returned.
Constructor Summary | |
---|---|
BresenhamTerrainPicker(Spatial root)
Construct a new BresenhamTerrainPicker that works on the given TerrainPage. |
Method Summary | |
---|---|
protected boolean |
checkTriangles(float gridX,
float gridY,
Ray pick,
Vector3f intersection,
TerrainBlock block)
Check the two triangles of a given grid space for intersection. |
protected int |
findClosestHeightIndex(Vector3f position,
TerrainBlock block)
Finds the closest height point to a position. |
Vector3f |
getTerrainIntersection(Ray worldPick,
Vector3f store)
Ask for the point of intersection between the given ray and the terrain. |
protected boolean |
getTriangles(float gridX,
float gridY,
TerrainBlock block)
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(Spatial root)
page
- the TerrainPage to work on.Method Detail |
---|
public Vector3f getTerrainIntersection(Ray worldPick, Vector3f store)
worldPick
- our pick ray, in world space.store
- if not null, the results will be stored in this vector and the
vector returned. If store is null, a new vector will be
created.
protected boolean checkTriangles(float gridX, float gridY, Ray pick, Vector3f intersection, TerrainBlock block)
gridX
- grid rowgridY
- grid columnpick
- our pick rayintersection
- the store variableblock
- the terrain block we are currently testing against.
protected boolean getTriangles(float gridX, float gridY, TerrainBlock block)
gridX
- grid rowgridY
- grid columnblock
- the TerrainBlock we are working with
protected int findClosestHeightIndex(Vector3f position, TerrainBlock block)
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 |