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
ConstructorsConstructorDescriptionPlane(float nx, float ny, float nz, float c) Instantiate a plane with specified components.Plane(ConstPlane original) Instantiate a copy of the argument.Instantiate a plane with specified components.Plane(FloatBuffer buffer) Instantiate from a buffer. -
Method Summary
Modifier and TypeMethodDescriptionvoidcopyTo(FloatBuffer storeFloats) Write all 4 components to the start of the specified buffer.floatReturn 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.voidput(FloatBuffer storeBuffer) Write all 4 components to the specified buffer and advance the buffer's position by 4.voidset(float nx, float ny, float nz, float c) Set all 4 components to specified values.voidset(ConstPlane source) Set all 4 components from the argument.voidset(FloatBuffer buffer) Set all 4 components from the specified buffer.voidsetConstant(float c) Alter the constant.voidAlter the normal direction.floatsignedDistance(Vec3Arg point) Return the signed distance of the specified point.toString()Return a string representation of the plane, which is unaffected.
-
Constructor Details
-
Plane
Instantiate a copy of the argument.- Parameters:
original- the plane to copy (not null, unaffected)
-
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 from a buffer.- Parameters:
buffer- the desired component values (not null, unaffected, capacity≥4)
-
Plane
Instantiate a plane with specified components.- Parameters:
normal- the desired normal direction (not null, unaffected)c- the desired constant
-
-
Method Details
-
set
Set all 4 components from the argument.- Parameters:
source- the plane to copy (not null, unaffected)
-
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
-
set
Set all 4 components from the specified buffer.- Parameters:
buffer- the desired component values (not null, length≥4, unaffected)
-
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)
-
copyTo
Write all 4 components to the start of the specified buffer. The plane is unaffected.- Specified by:
copyToin interfaceConstPlane- Parameters:
storeFloats- the destination buffer (not null, capacity≥4)
-
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
-
put
Write all 4 components to the specified buffer and advance the buffer's position by 4. The plane is unaffected.- Specified by:
putin interfaceConstPlane- Parameters:
storeBuffer- the destination buffer (not null)
-
signedDistance
Return the signed distance of the specified point.- Specified by:
signedDistancein interfaceConstPlane- Parameters:
point- the point to measure (not null, unaffected)- Returns:
- the signed distance
-
toString
Return a string representation of the plane, which is unaffected. For example:Plane{(0.0 1.0 0.0) 0.0}
-