Package com.github.stephengold.joltjni
Class Plane
java.lang.Object
com.github.stephengold.joltjni.Plane
- All Implemented Interfaces:
ConstPlane
A math object used to represent a plane in 3-dimensional space.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfloatReturn the constant in single precision.Copy the normal direction.floatReturn the first (X) component of the normal direction.floatReturn the 2nd (Y) component of the normal direction.floatReturn the 3rd (Z) component of the normal direction.voidset(float nx, float ny, float nz, float c) Set all 4 components to specified values.voidsetConstant(float c) Alter the constant.voidAlter the normal direction.toString()Return a string representation of the plane, which is unaffected.
-
Constructor Details
-
Plane
public Plane(float nx, float ny, float nz, float c) Instantiate a plane with specified components.- Parameters:
nx- the X component of the desired normal directionny- the Y component of the desired normal directionnz- the Z component of the desired normal directionc- the desired constant
-
Plane
Instantiate a plane with specified components.- Parameters:
normal- the desired normal direction (not null, unaffected)c- the desired constant
-
-
Method Details
-
set
public void set(float nx, float ny, float nz, float c) Set all 4 components to specified values.- Parameters:
nx- the desired X component of the normal directionny- the desired Y component of the normal directionnz- the desired Z component of the normal directionc- the desired constant
-
setConstant
public void setConstant(float c) Alter the constant.- Parameters:
c- the desired value
-
setNormal
Alter the normal direction.- Parameters:
normal- the desired direction (not null, unaffected)
-
getConstant
public float getConstant()Return the constant in single precision. The plane is unaffected.- Specified by:
getConstantin interfaceConstPlane- Returns:
- the constant value
-
getNormal
Copy the normal direction. The plane is unaffected.- Specified by:
getNormalin interfaceConstPlane- Returns:
- a new direction vector
-
getNormalX
public float getNormalX()Return the first (X) component of the normal direction. The plane is unaffected.- Specified by:
getNormalXin interfaceConstPlane- Returns:
- the component value
-
getNormalY
public float getNormalY()Return the 2nd (Y) component of the normal direction. The plane is unaffected.- Specified by:
getNormalYin interfaceConstPlane- Returns:
- the component value
-
getNormalZ
public float getNormalZ()Return the 3rd (Z) component of the normal direction. The plane is unaffected.- Specified by:
getNormalZin interfaceConstPlane- Returns:
- the component value
-
toString
Return a string representation of the plane, which is unaffected. For example:Plane{(0.0 1.0 0.0) 0.0}
-