Package org.joml

Class Planed

    • Field Summary

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

      • a

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

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

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

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

      • Planed

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

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

        public Planed​(Vector3dc point,
                      Vector3dc normal)
        Create a new Planed 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
      • Planed

        public Planed​(double a,
                      double b,
                      double c,
                      double d)
        Create a new Planed 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
      • Planed

        public Planed​(Vector3dc pointA,
                      Vector3dc pointB,
                      Vector3dc 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
      • Planed

        public Planed​(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
    • Method Detail

      • set

        public Planed set​(double a,
                          double b,
                          double c,
                          double 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 Planed normalize​()
        Normalize this plane.
        Returns:
        this
      • normalize

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

        public double distance​(double x,
                               double y,
                               double 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 Vector4d equationFromPoints​(Vector3d v0,
                                                  Vector3d v1,
                                                  Vector3d v2,
                                                  Vector4d 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 Vector4d equationFromPoints​(double v0X,
                                                  double v0Y,
                                                  double v0Z,
                                                  double v1X,
                                                  double v1Y,
                                                  double v1Z,
                                                  double v2X,
                                                  double v2Y,
                                                  double v2Z,
                                                  Vector4d 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