com.jmex.terrain.util
Class BresenhamYUpGridTracer

java.lang.Object
  extended by com.jmex.terrain.util.AbstractBresenhamTracer
      extended by com.jmex.terrain.util.BresenhamYUpGridTracer

public class BresenhamYUpGridTracer
extends AbstractBresenhamTracer

An implementation of AbstractBresenhamTracer that works on the XZ plane, with positive Y as up.

Author:
Joshua Slack

Nested Class Summary
 
Nested classes/interfaces inherited from class com.jmex.terrain.util.AbstractBresenhamTracer
AbstractBresenhamTracer.Direction
 
Field Summary
protected static float TOLERANCE
           
 
Fields inherited from class com.jmex.terrain.util.AbstractBresenhamTracer
_gridLocation, _gridOrigin, _gridSpacing, _rayLocation, _walkRay, rayLength, stepDirection
 
Constructor Summary
BresenhamYUpGridTracer()
           
 
Method Summary
 boolean isRayPerpendicularToGrid()
           
 void next()
          Move us along our walkRay to the next grid location.
 void startWalk(Ray walkRay)
          Set up our position on the grid and initialize the tracer using the provided ray.
 
Methods inherited from class com.jmex.terrain.util.AbstractBresenhamTracer
getGridLocation, getGridOrigin, getGridSpacing, getLastStepDirection, getRayTraveled, setGridOrigin, setGridSpacing
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TOLERANCE

protected static float TOLERANCE
Constructor Detail

BresenhamYUpGridTracer

public BresenhamYUpGridTracer()
Method Detail

startWalk

public void startWalk(Ray walkRay)
Description copied from class: AbstractBresenhamTracer
Set up our position on the grid and initialize the tracer using the provided ray.

Specified by:
startWalk in class AbstractBresenhamTracer
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 class AbstractBresenhamTracer

isRayPerpendicularToGrid

public boolean isRayPerpendicularToGrid()
Specified by:
isRayPerpendicularToGrid in class AbstractBresenhamTracer
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().