Package org.joml

Class Planef

    • Field Summary

      Fields 
      Modifier and Type Field Description
      float a
      The factor a in the plane equation a*x + b*y + c*z + d = 0.
      float b
      The factor b in the plane equation a*x + b*y + c*z + d = 0.
      float c
      The factor c in the plane equation a*x + b*y + c*z + d = 0.
      float d
      The constant d in the plane equation a*x + b*y + c*z + d = 0.
    • Constructor Summary

      Constructors 
      Constructor Description
      Planef​()
      Create a new undefined Planef.
      Planef​(float a, float b, float c, float d)
      Create a new Planef with the plane equation a*x + b*y + c*z + d = 0.
      Planef​(Planef source)
      Create a new Planef as a copy of the given source.
      Planef​(Vector3fc point, Vector3fc normal)
      Create a new Planef from the given point lying on the plane and the given normal.
      Planef​(Vector3fc pointA, Vector3fc pointB, Vector3fc pointC)
      Create a new Planef from the given three points lying on the plane.
    • Field Detail

      • a

        public float a
        The factor a in the plane equation a*x + b*y + c*z + d = 0.
      • b

        public float b
        The factor b in the plane equation a*x + b*y + c*z + d = 0.
      • c

        public float c
        The factor c in the plane equation a*x + b*y + c*z + d = 0.
      • d

        public float d
        The constant d in the plane equation a*x + b*y + c*z + d = 0.
    • Constructor Detail

      • Planef

        public Planef​()
        Create a new undefined Planef.
      • Planef

        public Planef​(Planef source)
        Create a new Planef as a copy of the given source.
        Parameters:
        source - the Planef to copy from
      • Planef

        public Planef​(Vector3fc point,
                      Vector3fc normal)
        Create a new Planef from the given point lying on the plane and the given normal.
        Parameters:
        point - any point lying on the plane
        normal - the normal of the plane
      • Planef

        public Planef​(Vector3fc pointA,
                      Vector3fc pointB,
                      Vector3fc pointC)
        Create a new Planef from the given three points lying on the plane.

        The resulting plane is not necessarily normalized.

        Parameters:
        pointA - the first point
        pointB - the second point
        pointC - the third point
      • Planef

        public Planef​(float a,
                      float b,
                      float c,
                      float d)
        Create a new Planef with the plane equation a*x + b*y + c*z + d = 0.
        Parameters:
        a - the x factor in the plane equation
        b - the y factor in the plane equation
        c - the z factor in the plane equation
        d - the constant in the plane equation
    • Method Detail

      • set

        public Planef set​(float a,
                          float b,
                          float c,
                          float d)
        Set the components of this plane.
        Parameters:
        a - the x factor in the plane equation
        b - the y factor in the plane equation
        c - the z factor in the plane equation
        d - the constant in the plane equation
        Returns:
        this
      • normalize

        public Planef normalize​()
        Normalize this plane.
        Returns:
        this
      • normalize

        public Planef normalize​(Planef dest)
        Normalize this plane and store the result in dest.
        Parameters:
        dest - will hold the result
        Returns:
        dest
      • distance

        public float distance​(float x,
                              float y,
                              float z)
        Compute the signed distance between this plane and the given point.
        Parameters:
        x - the x coordinate of the point
        y - the y coordinate of the point
        z - the z coordinate of the point
        Returns:
        the signed distance between this plane and the point
      • equationFromPoints

        public static Vector4f equationFromPoints​(Vector3f v0,
                                                  Vector3f v1,
                                                  Vector3f v2,
                                                  Vector4f dest)
        Compute the factors a, b, c and d in the plane equation a*x + b*y + c*z + d = 0 from the given three points on the plane, and write the values to the x, y, z and w components, respectively, of the given dest vector.
        Parameters:
        v0 - the first point on the plane
        v1 - the second point on the plane
        v2 - the third point on the plane
        dest - will hold the result
        Returns:
        dest
      • equationFromPoints

        public static Vector4f equationFromPoints​(float v0X,
                                                  float v0Y,
                                                  float v0Z,
                                                  float v1X,
                                                  float v1Y,
                                                  float v1Z,
                                                  float v2X,
                                                  float v2Y,
                                                  float v2Z,
                                                  Vector4f dest)
        Compute the factors a, b, c and d in the plane equation a*x + b*y + c*z + d = 0 from the three points (v0X, v0Y, v0Z), (v1X, v1Y, v1Z) and (v2X, v2Y, v2Z) on the plane, and write the values to the x, y, z and w components, respectively, of the given dest vector.
        Parameters:
        v0X - the x coordinate of the first point on the plane
        v0Y - the y coordinate of the first point on the plane
        v0Z - the z coordinate of the first point on the plane
        v1X - the x coordinate of the second point on the plane
        v1Y - the y coordinate of the second point on the plane
        v1Z - the z coordinate of the second point on the plane
        v2X - the x coordinate of the third point on the plane
        v2Y - the y coordinate of the third point on the plane
        v2Z - the z coordinate of the third point on the plane
        dest - will hold the result
        Returns:
        dest
      • hashCode

        public int hashCode​()
        Overrides:
        hashCode in class Object
      • toString

        public String toString​()
        Return a string representation of this plane.

        This method creates a new DecimalFormat on every invocation with the format string "0.000E0;-".

        Overrides:
        toString in class Object
        Returns:
        the string representation
      • toString

        public String toString​(NumberFormat formatter)
        Return a string representation of this plane by formatting the components with the given NumberFormat.
        Parameters:
        formatter - the NumberFormat used to format the components with
        Returns:
        the string representation