Class EntityHit


  • public class EntityHit
    extends java.lang.Object
    The result of an intersection between a ray and an entity.
    • Constructor Summary

      Constructors 
      Constructor Description
      EntityHit​(Entity entity, Vector3d intersection, Vector3d normal, double distance)
      Creates a new entity hit from the entity, the intersection point and the normal.
    • 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 entity
        intersection - The intersection point
        normal - The intersection normal
        distance - 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
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object