Class Plane3f

  • All Implemented Interfaces:
    java.io.Serializable

    public class Plane3f
    extends java.lang.Object
    implements java.io.Serializable
    The plane is represented as Dot(N,X) = c where N is a unit-length normal vector, c is the plane constant, and X is any point on the plane. The user must ensure that the normal vector satisfies this condition.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      Plane3f()
      Default constructor, uninitialized.
      Plane3f​(Plane3f rkPlane)
      Copy constructor.
      Plane3f​(Vector3f rkNormal, float fConstant)
      specify N and c directly
      Plane3f​(Vector3f rkNormal, Vector3f rkP)
      N is specified, c = Dot(N,P) where P is on the plane
      Plane3f​(Vector3f rkP0, Vector3f rkP1, Vector3f rkP2)
      N = Cross(P1-P0,P2-P0)/Length(Cross(P1-P0,P2-P0)), c = Dot(N,P0) where P0, P1, P2 are points on the plane.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void dispose()
      delete memory
      float DistanceTo​(Vector3f rkP)
      Compute d = Dot(N,Q)-c where N is the plane normal and c is the plane constant.
      int WhichSide​(Vector3f rkQ)
      The "positive side" of the plane is the half space to which the plane normal points.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • Normal

        public Vector3f Normal
        Plane normal:
      • Constant

        public float Constant
        Plane constant:
    • Constructor Detail

      • Plane3f

        public Plane3f()
        Default constructor, uninitialized.
      • Plane3f

        public Plane3f​(Plane3f rkPlane)
        Copy constructor.
        Parameters:
        rkPlane - plane to copy.
      • Plane3f

        public Plane3f​(Vector3f rkNormal,
                       float fConstant)
        specify N and c directly
        Parameters:
        rkNormal - normal vector
        fConstant - plane constant
      • Plane3f

        public Plane3f​(Vector3f rkNormal,
                       Vector3f rkP)
        N is specified, c = Dot(N,P) where P is on the plane
        Parameters:
        rkNormal - normal vector
        rkP - point on the plane
      • Plane3f

        public Plane3f​(Vector3f rkP0,
                       Vector3f rkP1,
                       Vector3f rkP2)
        N = Cross(P1-P0,P2-P0)/Length(Cross(P1-P0,P2-P0)), c = Dot(N,P0) where P0, P1, P2 are points on the plane.
        Parameters:
        rkP0 - point0
        rkP1 - point1
        rkP2 - point2
    • Method Detail

      • dispose

        public void dispose()
        delete memory
      • DistanceTo

        public float DistanceTo​(Vector3f rkP)
        Compute d = Dot(N,Q)-c where N is the plane normal and c is the plane constant. This is a signed distance. The sign of the return value is positive if the point is on the positive side of the plane, negative if the point is on the negative side, and zero if the point is on the plane.
        Parameters:
        rkP - point
        Returns:
        distance.
      • WhichSide

        public int WhichSide​(Vector3f rkQ)
        The "positive side" of the plane is the half space to which the plane normal points. The "negative side" is the other half space. The function returns +1 for the positive side, -1 for the negative side, and 0 for the point being on the plane.
        Parameters:
        rkQ - point
        Returns:
        +1 for the positive side, -1 for the negative side, and 0 for the point being on the plane.