Class BresenhamZUpGridTracer
java.lang.Object
com.ardor3d.extension.terrain.util.AbstractBresenhamTracer
com.ardor3d.extension.terrain.util.BresenhamZUpGridTracer
An implementation of AbstractBresenhamTracer that works on the XY plane, with positive Z as up.
-
Nested Class Summary
Nested classes/interfaces inherited from class com.ardor3d.extension.terrain.util.AbstractBresenhamTracer
AbstractBresenhamTracer.Direction
-
Field Summary
Fields inherited from class com.ardor3d.extension.terrain.util.AbstractBresenhamTracer
_gridLocation, _gridOrigin, _gridSpacing, _rayLocation, _stepDirection, _totalTravel, _walkRay
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionget2DPoint
(ReadOnlyVector3 worldLocation, Vector2 store) Casts a world location to the local plane of this tracer.get3DPoint
(double gridX, double gridY, double height, Vector3 store) Turns a point on a 2D grid and a height into a 3D point based on the world up of this tracer.boolean
void
next()
Move us along our walkRay to the next grid location.void
Set up our position on the grid and initialize the tracer using the provided ray.Methods inherited from class com.ardor3d.extension.terrain.util.AbstractBresenhamTracer
getGridLocation, getGridOrigin, getGridSpacing, getLastStepDirection, getTotalTraveled, setGridOrigin, setGridSpacing
-
Field Details
-
TOLERANCE
protected static double TOLERANCE
-
-
Constructor Details
-
BresenhamZUpGridTracer
public BresenhamZUpGridTracer()
-
-
Method Details
-
startWalk
Description copied from class:AbstractBresenhamTracer
Set up our position on the grid and initialize the tracer using the provided ray.- Specified by:
startWalk
in classAbstractBresenhamTracer
- Parameters:
walkRay
- the world ray along which we we walk the grid.
-
next
public void next()Description copied from class:AbstractBresenhamTracer
Move us along our walkRay to the next grid location.- Specified by:
next
in classAbstractBresenhamTracer
-
isRayPerpendicularToGrid
public boolean isRayPerpendicularToGrid()- Specified by:
isRayPerpendicularToGrid
in classAbstractBresenhamTracer
- Returns:
- true if our walkRay, specified in startWalk, ended up being perpendicular to the grid (and therefore can not move to a new grid location on calls to next(). You should test this after calling startWalk and before calling next().
-
get3DPoint
Description copied from class:AbstractBresenhamTracer
Turns a point on a 2D grid and a height into a 3D point based on the world up of this tracer.- Specified by:
get3DPoint
in classAbstractBresenhamTracer
- Parameters:
gridX
- the abscissa of the gridgridY
- the ordinate of the gridheight
- the heightstore
- the vector to store our result in. if null a new vector is created and returned.- Returns:
- the vertex
-
get2DPoint
Description copied from class:AbstractBresenhamTracer
Casts a world location to the local plane of this tracer.- Specified by:
get2DPoint
in classAbstractBresenhamTracer
- Parameters:
worldLocation
- the world locationstore
- the store- Returns:
- the point on the plane used by this tracer.
-