Class PickPointFrustum


  • public class PickPointFrustum
    extends Frustum
    A viewport aligned Frustum that also stores the 2D screen rectangle that the Frustum contains.
    • Constructor Detail

      • PickPointFrustum

        public PickPointFrustum​(Frustum frustum,
                                java.awt.Rectangle rect)
        Constructs a new PickPointFrustum from another Frustum and screen rectangle
        Parameters:
        frustum - frustum to create the PickPointFrustum from
        rect - screen rectangle to store with this frustum
    • Method Detail

      • intersects

        public final boolean intersects​(java.awt.Rectangle rect)
        Returns true if the specified 2D screen Rectangle intersects the space enclosed by this view aligned frustums screen rectangle.
        Parameters:
        rect - the rectangle to test
        Returns:
        true if the specified Rectangle intersects the space enclosed by this Frustum, and false otherwise.
        Throws:
        java.lang.IllegalArgumentException - if the extent is null.
      • contains

        public final boolean contains​(double x,
                                      double y)
        Returns true if the specified point is inside the 2D screen rectangle enclosed by this frustum
        Parameters:
        x - the x coordinate to test.
        y - the y coordinate to test.
        Returns:
        true if the specified point is inside the space enclosed by this Frustum, and false otherwise.
        Throws:
        java.lang.IllegalArgumentException - if the point is null.
      • contains

        public final boolean contains​(java.awt.Point point)
        Returns true if the specified point is inside the 2D screen rectangle enclosed by this frustum
        Parameters:
        point - the point to test.
        Returns:
        true if the specified point is inside the space enclosed by this Frustum, and false otherwise.
        Throws:
        java.lang.IllegalArgumentException - if the point is null.
      • transformBy

        public PickPointFrustum transformBy​(Matrix matrix)
        Returns a copy of this PickPointFrustum which is transformed by the specified Matrix.
        Overrides:
        transformBy in class Frustum
        Parameters:
        matrix - the Matrix to transform this Frustum by.
        Returns:
        a copy of this Frustum, transformed by the specified Matrix.
        Throws:
        java.lang.IllegalArgumentException - if the matrix is null
      • getScreenRect

        public java.awt.Rectangle getScreenRect()
        Returns the screenRect associated with this frustum
        Returns:
        screenRect associated with this frustum