// Path: src/roquen/fake/Vect3f.java
// public class Vect3f {
//   public float x,y,z;
//   
//   /** */
//   private static final int HASH = hashMakeSeed(0);
//   
//   @Override
//   public int hashCode()
//   {
//     return hashComplete(hashAdd(HASH,x,y,z));
//   }
//   
//   public final float dot(Vect3f v)
//   {
//     return x*v.x + y*v.y + z*v.z;
//   }
// }


import roquen.fake.Vect3f;

package roquen.interp;


/**
 * For performing in-order walks of cells on a uniform 3D grid which
 * are crossed by a line segment or ray.  It is equivalent to a
 * Bresenham's line walk.
 * <p>
 * Passed in values make the assumption that the extent of cells are
 * of one unit.  User code scaling is required for other sizes.
 * <p>
 * The name is actually a misnomer as the computation is in floating
 * point.  This drastically reduces the complexity of the update.
 */
public class DDA3D {
  // NOTE: Computation is in doubles.  Usage requires little memory
  // motion and the extra bits allow for larger grids.
  
  /** 
   * use-case specific cell offset. default=0 (lower left).
   * set to .5 for center of cell for example.
   */
  private double offset;
  
  /** current number of steps (integer) */
  private double step;
  
  /** inverse the number of steps (one rounding error) */
  private double in;
  
  /** coordinate of cell containing the first point (integer) */
  private double x0,y0,z0;
  
  /** integer displacement from first to last cell (integer) */
  private double dx,dy,dz;
  
  /** current step (cell) coordinate, includes fractional */
  public double x,y,z;
  
  /**
   * Sets the instance to iterate over all cells covered
   * by the line segment from p0 to p1 in order.  Return
   * the number of steps required.
   * <p>
   * The fields ({@link #x}, {@link #y}, {@link #z}) are
   * set to the first cell coordinate.
   */

// Path: src/roquen/fake/Vect3f.java
// public class Vect3f {
//   public float x,y,z;
//   
//   /** */
//   private static final int HASH = hashMakeSeed(0);
//   
//   @Override
//   public int hashCode()
//   {
//     return hashComplete(hashAdd(HASH,x,y,z));
//   }
//   
//   public final float dot(Vect3f v)
//   {
//     return x*v.x + y*v.y + z*v.z;
//   }
// }


// Path: src/roquen/interp/DDA3D.java
import roquen.fake.Vect3f;

package roquen.interp;


/**
 * For performing in-order walks of cells on a uniform 3D grid which
 * are crossed by a line segment or ray.  It is equivalent to a
 * Bresenham's line walk.
 * <p>
 * Passed in values make the assumption that the extent of cells are
 * of one unit.  User code scaling is required for other sizes.
 * <p>
 * The name is actually a misnomer as the computation is in floating
 * point.  This drastically reduces the complexity of the update.
 */
public class DDA3D {
  // NOTE: Computation is in doubles.  Usage requires little memory
  // motion and the extra bits allow for larger grids.
  
  /** 
   * use-case specific cell offset. default=0 (lower left).
   * set to .5 for center of cell for example.
   */
  private double offset;
  
  /** current number of steps (integer) */
  private double step;
  
  /** inverse the number of steps (one rounding error) */
  private double in;
  
  /** coordinate of cell containing the first point (integer) */
  private double x0,y0,z0;
  
  /** integer displacement from first to last cell (integer) */
  private double dx,dy,dz;
  
  /** current step (cell) coordinate, includes fractional */
  public double x,y,z;
  
  /**
   * Sets the instance to iterate over all cells covered
   * by the line segment from p0 to p1 in order.  Return
   * the number of steps required.
   * <p>
   * The fields ({@link #x}, {@link #y}, {@link #z}) are
   * set to the first cell coordinate.
   */

  public int set(Vect3f p0, Vect3f p1)
