Class EntityHit
- java.lang.Object
-
- org.spongepowered.api.world.volume.EntityHit
-
public class EntityHit extends Object
The result of an intersection between a ray and an entity.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
distance()
Gets the distance from the start to the intersection.Entity
entity()
Gets the intersected entity.boolean
equals(Object other)
int
hashCode()
Vector3d
intersection()
Gets the intersection point.Vector3d
normal()
Gets the intersection normal.String
toString()
-
-
-
Constructor Detail
-
EntityHit
public EntityHit(Entity entity, Vector3d intersection, Vector3d normal, double distance)
Creates a new entity hit from the entity, the intersection point and the normal.- Parameters:
entity
- The intersected entityintersection
- The intersection pointnormal
- The intersection normaldistance
- The distance from the start to the intersection
-
-
Method Detail
-
entity
public Entity entity()
Gets the intersected entity.- Returns:
- The intersected entity
-
intersection
public Vector3d intersection()
Gets the intersection point.- Returns:
- The point of intersection
-
normal
public Vector3d normal()
Gets the intersection normal.- Returns:
- The normal of intersection
-
distance
public double distance()
Gets the distance from the start to the intersection.- Returns:
- The distance from the start to the intersection
-
-