Package org.joml

## Class Planef

• java.lang.Object
• org.joml.Planef

• public class Planef
extends java.lang.Object
Represents a 3D plane using single-precision floating-point numbers.
Author:
Kai Burjack
• ### Field Summary

Fields
Modifier and Type Field Description
float a
float b
float c
float d
• ### 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.
• ### Method Summary

All Methods
Modifier and Type Method Description
boolean equals​(java.lang.Object obj)
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.
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.
int hashCode()
Planef normalize()
Normalize this plane.
Planef normalize​(Planef dest)
Normalize this plane and store the result in dest.
Planef set​(float a, float b, float c, float d)
Set the components of this plane.
java.lang.String toString()
Return a string representation of this plane.
java.lang.String toString​(java.text.NumberFormat formatter)
Return a string representation of this plane by formatting the components with the given NumberFormat.
• ### Methods inherited from class java.lang.Object

clone, finalize, getClass, notify, notifyAll, wait, wait, wait
• ### Field Detail

• #### a

public float a
• #### b

public float b
• #### c

public float c
• #### d

public float d
• ### 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​(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
• #### 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 java.lang.Object
• #### equals

public boolean equals​(java.lang.Object obj)
Overrides:
equals in class java.lang.Object
• #### toString

public java.lang.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 java.lang.Object
Returns:
the string representation
• #### toString

public java.lang.String toString​(java.text.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