public class RaytraceWorld
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
RaytraceWorld.Options
The Class Options.
|
Modifier and Type | Field and Description |
---|---|
java.util.HashMap<net.minecraft.world.ChunkPosition,net.minecraft.util.MovingObjectPosition> |
blockPassed
List of blocks passed by the ray trace.
|
net.minecraft.util.MovingObjectPosition |
firstHit
The first block to be hit.
|
int |
options
Options for the ray tracing.
|
Constructor and Description |
---|
RaytraceWorld(Point src,
Point dest)
Instantiates a new
RaytraceWorld . |
RaytraceWorld(Point src,
Point dest,
int options)
Instantiates a new
RaytraceWorld . |
RaytraceWorld(Point src,
Vector v)
Instantiates a new
RaytraceWorld . |
RaytraceWorld(Point src,
Vector v,
int options)
Instantiates a new
RaytraceWorld . |
RaytraceWorld(Ray ray)
Instantiates a new
RaytraceWorld . |
RaytraceWorld(Ray ray,
int options)
Instantiates a new
RaytraceWorld . |
Modifier and Type | Method and Description |
---|---|
Vector |
direction()
Gets the direction vector of the ray.
|
double |
distance()
Gets the length of the ray.
|
Point |
getDestination()
Gets the destination of this
RaytraceWorld . |
double |
getMin(double x,
double y,
double z)
Gets the minimum value of
x , y , z . |
Point |
getSource()
Gets the source of this
RaytraceWorld |
boolean |
hasOption(int opt)
Checks if the option
opt is set. |
net.minecraft.util.MovingObjectPosition |
rayTraceBlock(int x,
int y,
int z,
Point exit)
Raytraces inside an actual block area.
|
void |
setLength(double length)
Sets the length of this
RaytraceWorld . |
net.minecraft.util.MovingObjectPosition |
trace()
Does the raytracing.
|
public net.minecraft.util.MovingObjectPosition firstHit
dest
without any hit, firstHit
will have
typeOfHit
= MISSpublic java.util.HashMap<net.minecraft.world.ChunkPosition,net.minecraft.util.MovingObjectPosition> blockPassed
LOG_BLOCK_PASSED
is setpublic int options
public RaytraceWorld(Ray ray, int options)
RaytraceWorld
.ray
- the rayoptions
- the optionspublic RaytraceWorld(Ray ray)
RaytraceWorld
.ray
- the raypublic RaytraceWorld(Point src, Vector v, int options)
RaytraceWorld
.src
- the srcv
- the voptions
- the optionspublic RaytraceWorld(Point src, Vector v)
RaytraceWorld
.src
- the srcv
- the vpublic RaytraceWorld(Point src, Point dest, int options)
RaytraceWorld
.src
- the srcdest
- the destoptions
- the optionspublic RaytraceWorld(Point src, Point dest)
RaytraceWorld
.src
- the srcdest
- the destpublic Point getSource()
RaytraceWorld
public Point getDestination()
RaytraceWorld
.public Vector direction()
public double distance()
public void setLength(double length)
RaytraceWorld
.length
- the new lengthpublic boolean hasOption(int opt)
opt
is set.opt
- the option to checkpublic net.minecraft.util.MovingObjectPosition trace()
MovingObjectPosition
with typeOfHit
BLOCK if a ray hits a block in the way, or MISS if it
reaches dest
without any hitpublic double getMin(double x, double y, double z)
x
, y
, z
.x
- the xy
- the yz
- the zDouble.NaN
if x
, y
and z
are all three are Double.NaN
public net.minecraft.util.MovingObjectPosition rayTraceBlock(int x, int y, int z, Point exit)
Block.collisionRayTrace(World, int, int, int, net.minecraft.util.Vec3, net.minecraft.util.Vec3)
x
- the x coordinate of the block to tracey
- the y coordinate of the block to tracez
- the z coordinate of the block to traceexit
- the exitMovingObjectPosition
return by block raytrace