Package raymarcher
Class MeshGroup
java.lang.Object
raymarcher.MeshGroup
- All Implemented Interfaces:
Mesh
public class MeshGroup extends java.lang.Object implements Mesh
A class that allows for seperate meshes and geometry to be combined
into a single mesh using boolean operations, to create more complex
geometry.
Wikipedia Constructive Solid Geometery
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classMeshGroup.IntersectionGroupAn inner class representing a mesh group made with the intersection operationclassMeshGroup.SubtractGroupAn inner class representing a mesh group made with the subtract operationclassMeshGroup.UnionGroupAn inner class representing a mesh group made with the union operation -
Field Summary
Fields Modifier and Type Field Description static intINTERSECTIONThe value for a boolean intersection operationprivate java.awt.ColormeshColorThe color of the mesh groupprivate MeshmeshGroupThe meshgroup created for the given meshesstatic intSUBTRACTThe value for a boolean subtraction operationstatic intUNIONThe value for a boolean union operation -
Constructor Summary
-
Method Summary
Modifier and Type Method Description java.awt.ColorgetMeshColor()Gives the mesh's colordoublesdf(Vector3 position)The signed distance function for the mesh, which tells the mesh's distance to a point in 3D spacevoidsetMeshColor(java.awt.Color meshColor)Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
UNION
public static final int UNIONThe value for a boolean union operation- See Also:
- Constant Field Values
-
SUBTRACT
public static final int SUBTRACTThe value for a boolean subtraction operation- See Also:
- Constant Field Values
-
INTERSECTION
public static final int INTERSECTIONThe value for a boolean intersection operation- See Also:
- Constant Field Values
-
meshColor
private java.awt.Color meshColorThe color of the mesh group -
meshGroup
The meshgroup created for the given meshes
-
-
Constructor Details
-
MeshGroup
Creates a mesh group with one of three boolean operations- Parameters:
mesh1- The first mesh in for the boolean operationmesh2- The second mesh in for the boolean operationoperation- The operation used to create the groupmeshColor- The color of the new mesh group
-
-
Method Details
-
setMeshColor
public void setMeshColor(java.awt.Color meshColor)- Parameters:
meshColor- the color to set this mesh group to
-
getMeshColor
public java.awt.Color getMeshColor()Description copied from interface:MeshGives the mesh's color- Specified by:
getMeshColorin interfaceMesh- Returns:
- The color of the mesh
-
sdf
Description copied from interface:MeshThe signed distance function for the mesh, which tells the mesh's distance to a point in 3D space- Specified by:
sdfin interfaceMesh- Parameters:
position- The vector representation of the position of the point to measure the distance to- Returns:
- The signed distance of the mesh to the point. Values > 0 indicate the point is outside the mesh, values = 0 are points on the surface, and values < 0 are points inside the mesh.
-