Package dev.cerus.maps.raycast
Class RayCaster
java.lang.Object
dev.cerus.maps.raycast.RayCaster
Utility for casting rays
Used to detect objects in the Minecraft world
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescription<T> RayCaster.Result<T>
cast(org.bukkit.Location pos, org.bukkit.util.Vector direction, double length, double multiplier, Function<org.bukkit.Location,T> obstructionFunc, boolean collectPoints)
Cast a ray
-
Constructor Details
-
RayCaster
public RayCaster()
-
-
Method Details
-
cast
public <T> RayCaster.Result<T> cast(org.bukkit.Location pos, org.bukkit.util.Vector direction, double length, double multiplier, Function<org.bukkit.Location,T> obstructionFunc, boolean collectPoints)Cast a ray- Type Parameters:
T
- The type of obstruction that we could encounter- Parameters:
pos
- The starting position of the ray castdirection
- The direction that the ray should head inlength
- The length that the ray should travelmultiplier
- The size of each stepobstructionFunc
- Function for detecting obstructionscollectPoints
- Whether we should keep track of each point we have travelled or not- Returns:
- The result of this ray cast operation
-