Module org.dyn4j

Class Raycast

    • Constructor Detail

      • Raycast

        public Raycast()
        Default constructor.
    • Method Detail

      • clear

        public void clear()
        Clears this object setting all values to their default values.
      • getPoint

        public Vector2 getPoint()
        Returns the hit point.
        Returns:
        Vector2
      • setPoint

        public void setPoint​(Vector2 point)
        Sets the hit point.
        Parameters:
        point - the hit point
      • getNormal

        public Vector2 getNormal()
        Returns the normal at the hit point.
        Returns:
        Vector2
      • setNormal

        public void setNormal​(Vector2 normal)
        Sets the normal at the hit point.
        Parameters:
        normal - the normal at the hit point
      • getDistance

        public double getDistance()
        Returns the distance from the start of the Ray to the hit point.
        Returns:
        double
      • setDistance

        public void setDistance​(double distance)
        Sets the distance from the start of the Ray to the hit point.
        Parameters:
        distance - the distance
      • copy

        public void copy​(Raycast raycast)
        Copies (deep) the given Raycast information to this Raycast.
        Parameters:
        raycast - the raycast to copy
        Since:
        4.0.0
      • shift

        public void shift​(Vector2 shift)
        Description copied from interface: Shiftable
        Translates the object to match the given coordinate shift.
        Specified by:
        shift in interface Shiftable
        Parameters:
        shift - the amount to shift along the x and y axes
      • copy

        public Raycast copy()
        Description copied from interface: Copyable
        Returns a deep copy of this object.
        Specified by:
        copy in interface Copyable<Raycast>
        Returns:
        T