public abstract class AbstractRay<T extends AbstractRayResult<?>> extends Object
Modifier and Type | Field and Description |
---|---|
protected Location |
basePosition |
protected double |
lastDistance |
protected int |
maxDistance |
protected Location |
position |
protected HashMap<Vector,Material> |
testedVec |
protected Vector |
vector |
protected World |
w |
Modifier | Constructor and Description |
---|---|
protected |
AbstractRay(World w,
Location position,
Vector vector,
int maxDistance) |
Modifier and Type | Method and Description |
---|---|
T |
compile()
Compile the block ray
|
protected abstract T |
createResult(RayResult ray) |
Location |
getBasePosition()
Get the begin point of the ray.
|
double |
getLastDistance()
Get the last distance
|
Location |
getPosition()
Get position of ray.
|
HashMap<Vector,Material> |
getTestedVectors()
Get all tested vector with the material (or a default one if block have not been get
|
Vector |
getVector()
Direction of ray (rotation of entity by default
|
World |
getWorld()
Get world where is the ray action
|
protected RayResult |
tryLoc0(Vector v) |
protected abstract RayResult |
tryLocation(Vector v) |
protected final World w
protected final Location basePosition
protected final Vector vector
protected final int maxDistance
protected double lastDistance
protected Location position
public World getWorld()
public Location getBasePosition()
public Location getPosition()
public Vector getVector()
public HashMap<Vector,Material> getTestedVectors()
public double getLastDistance()
public T compile()