code: private int pointToGridIdx(Grid grid, float x, float y, float z) {
          Vec3f size = grid.getSize();
  
          int idx = calcIndex(x, size.getX(), grid.getMin().getX(), grid.getDivision().getX());
          int idy = calcIndex(y, size.getY(), grid.getMin().getY(), grid.getDivision().getY());
          int idz = calcIndex(z, size.getZ(), grid.getMin().getZ(), grid.getDivision().getZ());
  
          return idx + grid.getDivision().getX() * (idy + grid.getDivision().getY() * idz);
      }
docs: Convert a point to a grid index.
  
  @param grid grid definition
  @return grid index of point