java.lang.Object
com.marginallyclever.convenience.Plane

public class Plane extends Object
Plane and intersection functions. A plane is defined by a point and a normal.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    double
     
    javax.vecmath.Vector3d
     
  • Constructor Summary

    Constructors
    Constructor
    Description
     
    Plane(javax.vecmath.Point3d p0, javax.vecmath.Point3d p1, javax.vecmath.Point3d p2)
     
    Plane(javax.vecmath.Tuple3d point, javax.vecmath.Vector3d normal)
     
    Plane(javax.vecmath.Vector3d normal, double distance)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    double
     
    javax.vecmath.Vector3d
     
    javax.vecmath.Tuple3d
     
    boolean
    intersect(Ray r, javax.vecmath.Point3d intersection)
     
    double
    finds the intersection of a ray and this plane.
    boolean
    intersects(javax.vecmath.Point3d point)
     
    boolean
    intersects(javax.vecmath.Point3d point, double epsilon)
     
    void
    set(Plane arg0)
    set this plane to the same values as arg0

    Methods inherited from class java.lang.Object

    equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • distance

      public double distance
    • normal

      public javax.vecmath.Vector3d normal
  • Constructor Details

    • Plane

      public Plane()
    • Plane

      public Plane(javax.vecmath.Tuple3d point, javax.vecmath.Vector3d normal)
    • Plane

      public Plane(javax.vecmath.Point3d p0, javax.vecmath.Point3d p1, javax.vecmath.Point3d p2)
    • Plane

      public Plane(javax.vecmath.Vector3d normal, double distance)
  • Method Details

    • intersects

      public boolean intersects(javax.vecmath.Point3d point, double epsilon)
      Parameters:
      point - the point to test
      epsilon - how close to the plane is close enough
      Returns:
      true if the point is on the plane
    • intersects

      public boolean intersects(javax.vecmath.Point3d point)
      Parameters:
      point - the point to test
      Returns:
      true if the point is within 0.0001 of the plane.
    • intersectDistance

      public double intersectDistance(Ray ray)
      finds the intersection of a ray and this plane.
      Parameters:
      ray - the ray to intersect.
      Returns:
      the distance along the ray to the intersection point. NaN if no intersection.
    • intersect

      public boolean intersect(Ray r, javax.vecmath.Point3d intersection)
    • set

      public void set(Plane arg0)
      set this plane to the same values as arg0
      Parameters:
      arg0 -
    • getNormal

      public javax.vecmath.Vector3d getNormal()
    • getDistance

      public double getDistance()
    • getPoint

      public javax.vecmath.Tuple3d getPoint()