Class Intersection



  • public class Intersection
    extends java.lang.Object
    • Constructor Detail

      • Intersection

        public Intersection​(Point point,
                            Side normal,
                            float distance)
        Parameters:
        point - intersection point
        normal - the normal
        distance - distance of the ray
    • Method Detail

      • getNormal

        public Side getNormal​()
        Returns:
        the normal
      • getPoint

        public Point getPoint​()
        Returns:
        intersection point
      • getDistance

        public float getDistance​()
        Returns:
        distance of the ray
      • intersect

        public static Intersection intersect​(Coordinate target,
                                             Point p,
                                             com.badlogic.gdx.math.Vector3 dir)
        performs a line-box intersection.
        The result are outside the coordiante grid field, so they are forced in it.
        Parameters:
        target - target coordinate
        p - starting point
        dir - direction of ray
        Returns:
        null if not hitting
      • calcNormal

        public void calcNormal​(Point p)
        Calcualte the normal based of the position of the point.
        Parameters:
        p -