public class PolygonModifier
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static void |
buildTangentBinormal(Mesh mesh)
This will create tangent and binormal on the mesh
Normal is required, if normal is not existing on the mesh, it will also create the normal data from position.
|
static void |
buildTangentBinormal(Scene scene)
This will create tangent and binormal on all meshes of the scene
Normal is required, if normal is not existing on the mesh, it will also create the normal data from position.
|
static VertexElementNormal |
generateNormal(Mesh mesh)
Generate normal data from Mesh definition
|
static VertexElementUV |
generateUV(Mesh mesh)
Generate UV data from the given input mesh
|
static VertexElementUV |
generateUV(Mesh mesh,
VertexElementNormal normals)
Generate UV data from the given input mesh and specified normal data.
|
static Mesh |
mergeMesh(java.util.List<Node> nodes)
Convert a whole node to a single transformed mesh
Vertex elements like normal/texture coordinates are not supported yet
|
static Mesh |
mergeMesh(Node node)
Convert a whole node to a single transformed mesh
Vertex elements like normal/texture coordinates are not supported yet
|
static Mesh |
mergeMesh(Scene scene)
Convert a whole scene to a single transformed mesh
Vertex elements like normal/texture coordinates are not supported yet
|
static void |
scale(Node node,
Vector3 scale)
Scale all geometries(Scale the control points not the transformation matrix) in this node
|
static Scene |
scale(Scene scene,
Vector3 scale)
Scale all geometries(Scale the control points not the transformation matrix) in this scene
|
static Mesh[] |
splitMesh(Mesh mesh,
SplitMeshPolicy policy)
Split mesh into sub-meshes by
VertexElementMaterial . |
static void |
splitMesh(Node node,
SplitMeshPolicy policy)
Split mesh into sub-meshes by
VertexElementMaterial . |
static void |
splitMesh(Node node,
SplitMeshPolicy policy,
boolean createChildNodes)
Split mesh into sub-meshes by
VertexElementMaterial . |
static void |
splitMesh(Node node,
SplitMeshPolicy policy,
boolean createChildNodes,
boolean removeOldMesh)
Split mesh into sub-meshes by
VertexElementMaterial . |
static void |
splitMesh(Scene scene,
SplitMeshPolicy policy)
Split mesh into sub-meshes by
VertexElementMaterial . |
static void |
splitMesh(Scene scene,
SplitMeshPolicy policy,
boolean removeOldMesh)
Split mesh into sub-meshes by
VertexElementMaterial . |
static int[][] |
triangulate(java.util.List<Vector4> controlPoints)
Convert a polygon into triangles, the order of the polygon is defined by the
controlPoints |
static int[][] |
triangulate(java.util.List<Vector4> controlPoints,
int[] polygon)
Convert a polygon into triangles
|
static int[][] |
triangulate(java.util.List<Vector4> controlPoints,
java.util.List<int[]> polygons)
Convert a polygon-based mesh into triangles
|
static int[][] |
triangulate(java.util.List<Vector4> controlPoints,
java.util.List<int[]> polygons,
boolean generateNormals,
Vector3[][] nor_out)
Convert a polygon-based mesh into full triangle mesh
|
static Mesh |
triangulate(Mesh mesh)
Convert a polygon-based mesh into full triangle mesh
|
static void |
triangulate(Scene scene)
Convert all polygon-based meshes into full triangle mesh
|
public static void triangulate(Scene scene)
scene
- The scene to processpublic static Mesh triangulate(Mesh mesh)
mesh
- The original non-triangle meshpublic static int[][] triangulate(java.util.List<Vector4> controlPoints, java.util.List<int[]> polygons, boolean generateNormals, Vector3[][] nor_out)
controlPoints
- Control points of the meshpolygons
- Polygon facesgenerateNormals
- Generate normalsnor_out
- Generated Per-control point normalpublic static int[][] triangulate(java.util.List<Vector4> controlPoints, java.util.List<int[]> polygons)
controlPoints
- Control points of the meshpolygons
- Polygon facespublic static int[][] triangulate(java.util.List<Vector4> controlPoints, int[] polygon)
controlPoints
- Control points of the meshpolygon
- Polygon facepublic static int[][] triangulate(java.util.List<Vector4> controlPoints)
controlPoints
controlPoints
- Control points of the meshpublic static Mesh mergeMesh(Scene scene)
scene
- The scene to mergepublic static Mesh mergeMesh(java.util.List<Node> nodes)
nodes
- The nodes to mergepublic static Mesh mergeMesh(Node node)
node
- The node to mergepublic static Scene scale(Scene scene, Vector3 scale)
scene
- The scene to scalescale
- The scale factorpublic static void scale(Node node, Vector3 scale)
node
- The node to scalescale
- The scale factorpublic static VertexElementNormal generateNormal(Mesh mesh)
public static VertexElementUV generateUV(Mesh mesh, VertexElementNormal normals)
mesh
- The input meshnormals
- The normal datapublic static VertexElementUV generateUV(Mesh mesh)
mesh
- The input meshpublic static void splitMesh(Node node, SplitMeshPolicy policy, boolean createChildNodes, boolean removeOldMesh)
VertexElementMaterial
.
Each sub-mesh will use only one material.
Perform mesh splitting on a nodenode
- policy
- createChildNodes
- Create child nodes for each sub-mesh.removeOldMesh
- Remove the old mesh after splitted, if this parameter is false, the old and new meshes will co-exists.public static void splitMesh(Node node, SplitMeshPolicy policy)
VertexElementMaterial
.
Each sub-mesh will use only one material.
Perform mesh splitting on a nodenode
- policy
- public static void splitMesh(Node node, SplitMeshPolicy policy, boolean createChildNodes)
VertexElementMaterial
.
Each sub-mesh will use only one material.
Perform mesh splitting on a nodenode
- policy
- createChildNodes
- Create child nodes for each sub-mesh.public static void splitMesh(Scene scene, SplitMeshPolicy policy, boolean removeOldMesh)
VertexElementMaterial
.
Each sub-mesh will use only one material.
Perform mesh splitting on all nodes of the scene.scene
- policy
- removeOldMesh
- public static void splitMesh(Scene scene, SplitMeshPolicy policy)
VertexElementMaterial
.
Each sub-mesh will use only one material.
Perform mesh splitting on all nodes of the scene.scene
- policy
- public static Mesh[] splitMesh(Mesh mesh, SplitMeshPolicy policy)
VertexElementMaterial
.
Each sub-mesh will use only one material.
The original mesh will not get changed.public static void buildTangentBinormal(Scene scene)
public static void buildTangentBinormal(Mesh mesh)