Class BresenhamZUpGridTracer

java.lang.Object
com.ardor3d.extension.terrain.util.AbstractBresenhamTracer
com.ardor3d.extension.terrain.util.BresenhamZUpGridTracer

public class BresenhamZUpGridTracer extends AbstractBresenhamTracer
An implementation of AbstractBresenhamTracer that works on the XY plane, with positive Z as up.
  • Field Details

    • TOLERANCE

      protected static double TOLERANCE
  • Constructor Details

    • BresenhamZUpGridTracer

      public BresenhamZUpGridTracer()
  • Method Details

    • startWalk

      public void startWalk(Ray3 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().
    • get3DPoint

      public Vector3 get3DPoint(double gridX, double gridY, double height, Vector3 store)
      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 class AbstractBresenhamTracer
      Parameters:
      gridX - the abscissa of the grid
      gridY - the ordinate of the grid
      height - the height
      store - the vector to store our result in. if null a new vector is created and returned.
      Returns:
      the vertex
    • get2DPoint

      public Vector2 get2DPoint(ReadOnlyVector3 worldLocation, Vector2 store)
      Description copied from class: AbstractBresenhamTracer
      Casts a world location to the local plane of this tracer.
      Specified by:
      get2DPoint in class AbstractBresenhamTracer
      Parameters:
      worldLocation - the world location
      store - the store
      Returns:
      the point on the plane used by this tracer.