Class MeshBuilder
- java.lang.Object
-
- com.badlogic.gdx.graphics.g3d.utils.MeshBuilder
-
- All Implemented Interfaces:
MeshPartBuilder
public class MeshBuilder extends java.lang.Object implements MeshPartBuilder
Class to construct a mesh, optionally splitting it into one or more mesh parts. Before you can call any other method you must callbegin(VertexAttributes)
orbegin(VertexAttributes, int)
. To use mesh parts you must callpart(String, int)
before you start building the part. The MeshPart itself is only valid after the call toend()
.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface com.badlogic.gdx.graphics.g3d.utils.MeshPartBuilder
MeshPartBuilder.VertexInfo
-
-
Field Summary
Fields Modifier and Type Field Description static int
MAX_INDEX
highest index mesh builder can get (64k - 1)static int
MAX_VERTICES
maximum number of vertices mesh builder can hold (64k)
-
Constructor Summary
Constructors Constructor Description MeshBuilder()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addMesh(float[] vertices, short[] indices)
Copies a mesh to the mesh (part) currently being build.void
addMesh(float[] vertices, short[] indices, int indexOffset, int numIndices)
Copies a (part of a) mesh to the mesh (part) currently being build.void
addMesh(MeshPart meshpart)
Copies a MeshPart to the mesh (part) currently being build.void
addMesh(Mesh mesh)
Copies a mesh to the mesh (part) currently being build.void
addMesh(Mesh mesh, int indexOffset, int numIndices)
Copies a (part of a) mesh to the mesh (part) currently being build.void
arrow(float x1, float y1, float z1, float x2, float y2, float z2, float capLength, float stemThickness, int divisions)
Deprecated.void
begin(long attributes)
Begin building a mesh.void
begin(long attributes, int primitiveType)
Begin building a mesh.void
begin(VertexAttributes attributes)
Begin building a mesh.void
begin(VertexAttributes attributes, int primitiveType)
Begin building a meshvoid
box(float width, float height, float depth)
Deprecated.void
box(float x, float y, float z, float width, float height, float depth)
Deprecated.void
box(MeshPartBuilder.VertexInfo corner000, MeshPartBuilder.VertexInfo corner010, MeshPartBuilder.VertexInfo corner100, MeshPartBuilder.VertexInfo corner110, MeshPartBuilder.VertexInfo corner001, MeshPartBuilder.VertexInfo corner011, MeshPartBuilder.VertexInfo corner101, MeshPartBuilder.VertexInfo corner111)
Deprecated.void
box(Matrix4 transform)
Deprecated.void
box(Vector3 corner000, Vector3 corner010, Vector3 corner100, Vector3 corner110, Vector3 corner001, Vector3 corner011, Vector3 corner101, Vector3 corner111)
Deprecated.void
capsule(float radius, float height, int divisions)
Deprecated.void
circle(float radius, int divisions, float centerX, float centerY, float centerZ, float normalX, float normalY, float normalZ)
Deprecated.void
circle(float radius, int divisions, float centerX, float centerY, float centerZ, float normalX, float normalY, float normalZ, float angleFrom, float angleTo)
Deprecated.void
circle(float radius, int divisions, float centerX, float centerY, float centerZ, float normalX, float normalY, float normalZ, float tangentX, float tangentY, float tangentZ, float binormalX, float binormalY, float binormalZ)
Deprecated.void
circle(float radius, int divisions, float centerX, float centerY, float centerZ, float normalX, float normalY, float normalZ, float tangentX, float tangentY, float tangentZ, float binormalX, float binormalY, float binormalZ, float angleFrom, float angleTo)
Deprecated.void
circle(float radius, int divisions, Vector3 center, Vector3 normal)
Deprecated.void
circle(float radius, int divisions, Vector3 center, Vector3 normal, float angleFrom, float angleTo)
Deprecated.void
circle(float radius, int divisions, Vector3 center, Vector3 normal, Vector3 tangent, Vector3 binormal)
Deprecated.void
circle(float radius, int divisions, Vector3 center, Vector3 normal, Vector3 tangent, Vector3 binormal, float angleFrom, float angleTo)
Deprecated.void
clear()
Clears the data being built up until now, including the vertices, indices and all parts.void
cone(float width, float height, float depth, int divisions)
Deprecated.void
cone(float width, float height, float depth, int divisions, float angleFrom, float angleTo)
Deprecated.static VertexAttributes
createAttributes(long usage)
void
cylinder(float width, float height, float depth, int divisions)
Deprecated.void
cylinder(float width, float height, float depth, int divisions, float angleFrom, float angleTo)
Deprecated.void
cylinder(float width, float height, float depth, int divisions, float angleFrom, float angleTo, boolean close)
Deprecated.void
ellipse(float width, float height, float innerWidth, float innerHeight, int divisions, float centerX, float centerY, float centerZ, float normalX, float normalY, float normalZ)
Deprecated.void
ellipse(float width, float height, float innerWidth, float innerHeight, int divisions, float centerX, float centerY, float centerZ, float normalX, float normalY, float normalZ, float angleFrom, float angleTo)
Deprecated.void
ellipse(float width, float height, float innerWidth, float innerHeight, int divisions, float centerX, float centerY, float centerZ, float normalX, float normalY, float normalZ, float tangentX, float tangentY, float tangentZ, float binormalX, float binormalY, float binormalZ, float angleFrom, float angleTo)
Deprecated.void
ellipse(float width, float height, float innerWidth, float innerHeight, int divisions, Vector3 center, Vector3 normal)
Deprecated.void
ellipse(float width, float height, int divisions, float centerX, float centerY, float centerZ, float normalX, float normalY, float normalZ)
Deprecated.void
ellipse(float width, float height, int divisions, float centerX, float centerY, float centerZ, float normalX, float normalY, float normalZ, float angleFrom, float angleTo)
Deprecated.void
ellipse(float width, float height, int divisions, float centerX, float centerY, float centerZ, float normalX, float normalY, float normalZ, float tangentX, float tangentY, float tangentZ, float binormalX, float binormalY, float binormalZ)
Deprecated.void
ellipse(float width, float height, int divisions, float centerX, float centerY, float centerZ, float normalX, float normalY, float normalZ, float tangentX, float tangentY, float tangentZ, float binormalX, float binormalY, float binormalZ, float angleFrom, float angleTo)
Deprecated.void
ellipse(float width, float height, int divisions, Vector3 center, Vector3 normal)
Deprecated.void
ellipse(float width, float height, int divisions, Vector3 center, Vector3 normal, float angleFrom, float angleTo)
Deprecated.void
ellipse(float width, float height, int divisions, Vector3 center, Vector3 normal, Vector3 tangent, Vector3 binormal)
Deprecated.void
ellipse(float width, float height, int divisions, Vector3 center, Vector3 normal, Vector3 tangent, Vector3 binormal, float angleFrom, float angleTo)
Deprecated.Mesh
end()
End building the mesh and returns the meshMesh
end(Mesh mesh)
End building the mesh and returns the meshvoid
ensureCapacity(int numVertices, int numIndices)
Increases the size of the backing vertices and indices arrays to accommodate the specified number of additional vertices and indices.void
ensureIndices(int numIndices)
Increases the size of the backing indices array to accommodate the specified number of additional indices.void
ensureRectangleIndices(int numRectangles)
Increases the size of the backing indices array to accommodate the specified number of additional rectangles.void
ensureRectangles(int numRectangles)
Deprecated.useensureVertices(int)
followed byensureRectangleIndices(int)
instead.void
ensureRectangles(int numVertices, int numRectangles)
Deprecated.useensureVertices(int)
followed byensureRectangleIndices(int)
instead.void
ensureTriangleIndices(int numTriangles)
Increases the size of the backing indices array to accommodate the specified number of additional triangles.void
ensureTriangles(int numTriangles)
Deprecated.useensureVertices(int)
followed byensureTriangleIndices(int)
instead.void
ensureTriangles(int numVertices, int numTriangles)
Deprecated.useensureVertices(int)
followed byensureTriangleIndices(int)
instead.void
ensureVertices(int numVertices)
Increases the size of the backing vertices array to accommodate the specified number of additional vertices.VertexAttributes
getAttributes()
int
getFloatsPerVertex()
protected short[]
getIndices()
Provides direct access to the indices array being built, use with care.void
getIndices(short[] out, int destOffset)
Get a copy of the indices built so far.MeshPart
getMeshPart()
int
getNumIndices()
int
getNumVertices()
int
getPrimitiveType()
Matrix4
getVertexTransform(Matrix4 out)
Get the current vertex transformation matrix.protected float[]
getVertices()
Provides direct access to the vertices array being built, use with care.void
getVertices(float[] out, int destOffset)
Get a copy of the vertices built so far.void
index(short value)
Add an index, MeshPartBuilder expects all meshes to be indexed.void
index(short value1, short value2)
Add multiple indices, MeshPartBuilder expects all meshes to be indexed.void
index(short value1, short value2, short value3)
Add multiple indices, MeshPartBuilder expects all meshes to be indexed.void
index(short value1, short value2, short value3, short value4)
Add multiple indices, MeshPartBuilder expects all meshes to be indexed.void
index(short value1, short value2, short value3, short value4, short value5, short value6)
Add multiple indices, MeshPartBuilder expects all meshes to be indexed.void
index(short value1, short value2, short value3, short value4, short value5, short value6, short value7, short value8)
Add multiple indices, MeshPartBuilder expects all meshes to be indexed.boolean
isVertexTransformationEnabled()
Indicates whether vertex transformation is enabled.int
lastIndex()
void
line(float x1, float y1, float z1, float x2, float y2, float z2)
Add a line.void
line(short index1, short index2)
Add a line by indices.void
line(MeshPartBuilder.VertexInfo p1, MeshPartBuilder.VertexInfo p2)
Add a line.void
line(Vector3 p1, Color c1, Vector3 p2, Color c2)
Add a line.void
line(Vector3 p1, Vector3 p2)
Add a line.MeshPart
part(java.lang.String id, int primitiveType)
Starts a new MeshPart.MeshPart
part(java.lang.String id, int primitiveType, MeshPart meshPart)
Starts a new MeshPart.void
patch(float x00, float y00, float z00, float x10, float y10, float z10, float x11, float y11, float z11, float x01, float y01, float z01, float normalX, float normalY, float normalZ, int divisionsU, int divisionsV)
Deprecated.void
patch(MeshPartBuilder.VertexInfo corner00, MeshPartBuilder.VertexInfo corner10, MeshPartBuilder.VertexInfo corner11, MeshPartBuilder.VertexInfo corner01, int divisionsU, int divisionsV)
Deprecated.void
patch(Vector3 corner00, Vector3 corner10, Vector3 corner11, Vector3 corner01, Vector3 normal, int divisionsU, int divisionsV)
Deprecated.void
rect(float x00, float y00, float z00, float x10, float y10, float z10, float x11, float y11, float z11, float x01, float y01, float z01, float normalX, float normalY, float normalZ)
Add a rectangle Requires GL_POINTS, GL_LINES or GL_TRIANGLES primitive type.void
rect(short corner00, short corner10, short corner11, short corner01)
Add a rectangle by indices.void
rect(MeshPartBuilder.VertexInfo corner00, MeshPartBuilder.VertexInfo corner10, MeshPartBuilder.VertexInfo corner11, MeshPartBuilder.VertexInfo corner01)
Add a rectangle.void
rect(Vector3 corner00, Vector3 corner10, Vector3 corner11, Vector3 corner01, Vector3 normal)
Add a rectangle.void
setColor(float r, float g, float b, float a)
Set the color used to tint the vertex color, defaults to white.void
setColor(Color color)
Set the color used to tint the vertex color, defaults to white.void
setUVRange(float u1, float v1, float u2, float v2)
Set range of texture coordinates used (default is 0,0,1,1).void
setUVRange(TextureRegion region)
Set range of texture coordinates from the specified TextureRegion.void
setVertexTransform(Matrix4 transform)
Set the current vertex transformation matrix and enables vertex transformation.void
setVertexTransformationEnabled(boolean enabled)
Sets whether vertex transformation is enabled.void
sphere(float width, float height, float depth, int divisionsU, int divisionsV)
Deprecated.void
sphere(float width, float height, float depth, int divisionsU, int divisionsV, float angleUFrom, float angleUTo, float angleVFrom, float angleVTo)
Deprecated.void
sphere(Matrix4 transform, float width, float height, float depth, int divisionsU, int divisionsV)
Deprecated.void
sphere(Matrix4 transform, float width, float height, float depth, int divisionsU, int divisionsV, float angleUFrom, float angleUTo, float angleVFrom, float angleVTo)
Deprecated.void
triangle(short index1, short index2, short index3)
Add a triangle by indices.void
triangle(MeshPartBuilder.VertexInfo p1, MeshPartBuilder.VertexInfo p2, MeshPartBuilder.VertexInfo p3)
Add a triangle.void
triangle(Vector3 p1, Color c1, Vector3 p2, Color c2, Vector3 p3, Color c3)
Add a triangle.void
triangle(Vector3 p1, Vector3 p2, Vector3 p3)
Add a triangle.short
vertex(float... values)
Add one or more vertices, returns the index of the last vertex added.short
vertex(MeshPartBuilder.VertexInfo info)
Add a vertex, returns the index.short
vertex(Vector3 pos, Vector3 nor, Color col, Vector2 uv)
Add a vertex, returns the index.
-
-
-
Field Detail
-
MAX_VERTICES
public static final int MAX_VERTICES
maximum number of vertices mesh builder can hold (64k)- See Also:
- Constant Field Values
-
MAX_INDEX
public static final int MAX_INDEX
highest index mesh builder can get (64k - 1)- See Also:
- Constant Field Values
-
-
Method Detail
-
createAttributes
public static VertexAttributes createAttributes(long usage)
- Parameters:
usage
- bitwise mask of theVertexAttributes.Usage
, only Position, Color, Normal and TextureCoordinates is supported.
-
begin
public void begin(long attributes)
Begin building a mesh. Callpart(String, int)
to start aMeshPart
.- Parameters:
attributes
- bitwise mask of theVertexAttributes.Usage
, only Position, Color, Normal and TextureCoordinates is supported.
-
begin
public void begin(VertexAttributes attributes)
Begin building a mesh. Callpart(String, int)
to start aMeshPart
.
-
begin
public void begin(long attributes, int primitiveType)
Begin building a mesh.- Parameters:
attributes
- bitwise mask of theVertexAttributes.Usage
, only Position, Color, Normal and TextureCoordinates is supported.
-
begin
public void begin(VertexAttributes attributes, int primitiveType)
Begin building a mesh
-
part
public MeshPart part(java.lang.String id, int primitiveType)
Starts a new MeshPart. The mesh part is not usable until end() is called. This will reset the current color and vertex transformation.- See Also:
part(String, int, MeshPart)
-
part
public MeshPart part(java.lang.String id, int primitiveType, MeshPart meshPart)
Starts a new MeshPart. The mesh part is not usable until end() is called. This will reset the current color and vertex transformation.- Parameters:
id
- The id (name) of the partprimitiveType
- e.g.GL20.GL_TRIANGLES
orGL20.GL_LINES
meshPart
- The part to receive the result
-
end
public Mesh end(Mesh mesh)
End building the mesh and returns the mesh- Parameters:
mesh
- The mesh to receive the built vertices and indices, must have the same attributes and must be big enough to hold the data, any existing data will be overwritten.
-
end
public Mesh end()
End building the mesh and returns the mesh
-
clear
public void clear()
Clears the data being built up until now, including the vertices, indices and all parts. Must be called in between the call to #begin and #end. Any builder calls made from the last call to #begin up until now are practically discarded. The state (e.g. UV region, color, vertex transform) will remain unchanged.
-
getFloatsPerVertex
public int getFloatsPerVertex()
- Returns:
- the size in number of floats of one vertex, multiply by four to get the size in bytes.
-
getNumVertices
public int getNumVertices()
- Returns:
- The number of vertices built up until now, only valid in between the call to begin() and end().
-
getVertices
public void getVertices(float[] out, int destOffset)
Get a copy of the vertices built so far.- Parameters:
out
- The float array to receive the copy of the vertices, must be at least `destOffset` +getNumVertices()
*getFloatsPerVertex()
in size.destOffset
- The offset (number of floats) in the out array where to start copying
-
getVertices
protected float[] getVertices()
Provides direct access to the vertices array being built, use with care. The size of the array might be bigger, do not rely on the length of the array. Instead usegetFloatsPerVertex()
*getNumVertices()
to calculate the usable size of the array. Must be called in between the call to #begin and #end.
-
getNumIndices
public int getNumIndices()
- Returns:
- The number of indices built up until now, only valid in between the call to begin() and end().
-
getIndices
public void getIndices(short[] out, int destOffset)
Get a copy of the indices built so far.- Parameters:
out
- The short array to receive the copy of the indices, must be at least `destOffset` +getNumIndices()
in size.destOffset
- The offset (number of shorts) in the out array where to start copying
-
getIndices
protected short[] getIndices()
Provides direct access to the indices array being built, use with care. The size of the array might be bigger, do not rely on the length of the array. Instead usegetNumIndices()
to calculate the usable size of the array. Must be called in between the call to #begin and #end.
-
getAttributes
public VertexAttributes getAttributes()
- Specified by:
getAttributes
in interfaceMeshPartBuilder
- Returns:
- The
VertexAttributes
available for building.
-
getMeshPart
public MeshPart getMeshPart()
- Specified by:
getMeshPart
in interfaceMeshPartBuilder
- Returns:
- The
MeshPart
currently building.
-
getPrimitiveType
public int getPrimitiveType()
- Specified by:
getPrimitiveType
in interfaceMeshPartBuilder
- Returns:
- The primitive type used for building, e.g.
GL20.GL_TRIANGLES
orGL20.GL_LINES
.
-
setColor
public void setColor(float r, float g, float b, float a)
Description copied from interface:MeshPartBuilder
Set the color used to tint the vertex color, defaults to white. Only applicable forVertexAttributes.Usage.ColorPacked
orVertexAttributes.Usage.ColorUnpacked
.- Specified by:
setColor
in interfaceMeshPartBuilder
-
setColor
public void setColor(Color color)
Description copied from interface:MeshPartBuilder
Set the color used to tint the vertex color, defaults to white. Only applicable forVertexAttributes.Usage.ColorPacked
orVertexAttributes.Usage.ColorUnpacked
.- Specified by:
setColor
in interfaceMeshPartBuilder
-
setUVRange
public void setUVRange(float u1, float v1, float u2, float v2)
Description copied from interface:MeshPartBuilder
Set range of texture coordinates used (default is 0,0,1,1).- Specified by:
setUVRange
in interfaceMeshPartBuilder
-
setUVRange
public void setUVRange(TextureRegion region)
Description copied from interface:MeshPartBuilder
Set range of texture coordinates from the specified TextureRegion.- Specified by:
setUVRange
in interfaceMeshPartBuilder
-
getVertexTransform
public Matrix4 getVertexTransform(Matrix4 out)
Description copied from interface:MeshPartBuilder
Get the current vertex transformation matrix.- Specified by:
getVertexTransform
in interfaceMeshPartBuilder
-
setVertexTransform
public void setVertexTransform(Matrix4 transform)
Description copied from interface:MeshPartBuilder
Set the current vertex transformation matrix and enables vertex transformation.- Specified by:
setVertexTransform
in interfaceMeshPartBuilder
-
isVertexTransformationEnabled
public boolean isVertexTransformationEnabled()
Description copied from interface:MeshPartBuilder
Indicates whether vertex transformation is enabled.- Specified by:
isVertexTransformationEnabled
in interfaceMeshPartBuilder
-
setVertexTransformationEnabled
public void setVertexTransformationEnabled(boolean enabled)
Description copied from interface:MeshPartBuilder
Sets whether vertex transformation is enabled.- Specified by:
setVertexTransformationEnabled
in interfaceMeshPartBuilder
-
ensureVertices
public void ensureVertices(int numVertices)
Description copied from interface:MeshPartBuilder
Increases the size of the backing vertices array to accommodate the specified number of additional vertices. Useful before adding many vertices to avoid multiple backing array resizes.- Specified by:
ensureVertices
in interfaceMeshPartBuilder
- Parameters:
numVertices
- The number of vertices you are about to add
-
ensureIndices
public void ensureIndices(int numIndices)
Description copied from interface:MeshPartBuilder
Increases the size of the backing indices array to accommodate the specified number of additional indices. Useful before adding many indices to avoid multiple backing array resizes.- Specified by:
ensureIndices
in interfaceMeshPartBuilder
- Parameters:
numIndices
- The number of indices you are about to add
-
ensureCapacity
public void ensureCapacity(int numVertices, int numIndices)
Description copied from interface:MeshPartBuilder
Increases the size of the backing vertices and indices arrays to accommodate the specified number of additional vertices and indices. Useful before adding many vertices and indices to avoid multiple backing array resizes.- Specified by:
ensureCapacity
in interfaceMeshPartBuilder
- Parameters:
numVertices
- The number of vertices you are about to addnumIndices
- The number of indices you are about to add
-
ensureTriangleIndices
public void ensureTriangleIndices(int numTriangles)
Description copied from interface:MeshPartBuilder
Increases the size of the backing indices array to accommodate the specified number of additional triangles. Useful before adding many triangles usingMeshPartBuilder.triangle(short, short, short)
to avoid multiple backing array resizes. The actual number of indices accounted for depends on the primitive type (seeMeshPartBuilder.getPrimitiveType()
).- Specified by:
ensureTriangleIndices
in interfaceMeshPartBuilder
- Parameters:
numTriangles
- The number of triangles you are about to add
-
ensureTriangles
@Deprecated public void ensureTriangles(int numVertices, int numTriangles)
Deprecated.useensureVertices(int)
followed byensureTriangleIndices(int)
instead.
-
ensureTriangles
@Deprecated public void ensureTriangles(int numTriangles)
Deprecated.useensureVertices(int)
followed byensureTriangleIndices(int)
instead.
-
ensureRectangleIndices
public void ensureRectangleIndices(int numRectangles)
Description copied from interface:MeshPartBuilder
Increases the size of the backing indices array to accommodate the specified number of additional rectangles. Useful before adding many rectangles usingMeshPartBuilder.rect(short, short, short, short)
to avoid multiple backing array resizes.- Specified by:
ensureRectangleIndices
in interfaceMeshPartBuilder
- Parameters:
numRectangles
- The number of rectangles you are about to add
-
ensureRectangles
@Deprecated public void ensureRectangles(int numVertices, int numRectangles)
Deprecated.useensureVertices(int)
followed byensureRectangleIndices(int)
instead.
-
ensureRectangles
@Deprecated public void ensureRectangles(int numRectangles)
Deprecated.useensureVertices(int)
followed byensureRectangleIndices(int)
instead.
-
lastIndex
public int lastIndex()
- Specified by:
lastIndex
in interfaceMeshPartBuilder
- Returns:
- The index of the last added vertex.
-
vertex
public short vertex(Vector3 pos, Vector3 nor, Color col, Vector2 uv)
Description copied from interface:MeshPartBuilder
Add a vertex, returns the index. Null values are allowed. UseMeshPartBuilder.getAttributes()
to check which values are available.- Specified by:
vertex
in interfaceMeshPartBuilder
-
vertex
public short vertex(float... values)
Description copied from interface:MeshPartBuilder
Add one or more vertices, returns the index of the last vertex added. The length of values must a power of the vertex size.- Specified by:
vertex
in interfaceMeshPartBuilder
-
vertex
public short vertex(MeshPartBuilder.VertexInfo info)
Description copied from interface:MeshPartBuilder
Add a vertex, returns the index. UseMeshPartBuilder.getAttributes()
to check which values are available.- Specified by:
vertex
in interfaceMeshPartBuilder
-
index
public void index(short value)
Description copied from interface:MeshPartBuilder
Add an index, MeshPartBuilder expects all meshes to be indexed.- Specified by:
index
in interfaceMeshPartBuilder
-
index
public void index(short value1, short value2)
Description copied from interface:MeshPartBuilder
Add multiple indices, MeshPartBuilder expects all meshes to be indexed.- Specified by:
index
in interfaceMeshPartBuilder
-
index
public void index(short value1, short value2, short value3)
Description copied from interface:MeshPartBuilder
Add multiple indices, MeshPartBuilder expects all meshes to be indexed.- Specified by:
index
in interfaceMeshPartBuilder
-
index
public void index(short value1, short value2, short value3, short value4)
Description copied from interface:MeshPartBuilder
Add multiple indices, MeshPartBuilder expects all meshes to be indexed.- Specified by:
index
in interfaceMeshPartBuilder
-
index
public void index(short value1, short value2, short value3, short value4, short value5, short value6)
Description copied from interface:MeshPartBuilder
Add multiple indices, MeshPartBuilder expects all meshes to be indexed.- Specified by:
index
in interfaceMeshPartBuilder
-
index
public void index(short value1, short value2, short value3, short value4, short value5, short value6, short value7, short value8)
Description copied from interface:MeshPartBuilder
Add multiple indices, MeshPartBuilder expects all meshes to be indexed.- Specified by:
index
in interfaceMeshPartBuilder
-
line
public void line(short index1, short index2)
Description copied from interface:MeshPartBuilder
Add a line by indices. Requires GL_LINES primitive type.- Specified by:
line
in interfaceMeshPartBuilder
-
line
public void line(MeshPartBuilder.VertexInfo p1, MeshPartBuilder.VertexInfo p2)
Description copied from interface:MeshPartBuilder
Add a line. Requires GL_LINES primitive type.- Specified by:
line
in interfaceMeshPartBuilder
-
line
public void line(Vector3 p1, Vector3 p2)
Description copied from interface:MeshPartBuilder
Add a line. Requires GL_LINES primitive type.- Specified by:
line
in interfaceMeshPartBuilder
-
line
public void line(float x1, float y1, float z1, float x2, float y2, float z2)
Description copied from interface:MeshPartBuilder
Add a line. Requires GL_LINES primitive type.- Specified by:
line
in interfaceMeshPartBuilder
-
line
public void line(Vector3 p1, Color c1, Vector3 p2, Color c2)
Description copied from interface:MeshPartBuilder
Add a line. Requires GL_LINES primitive type.- Specified by:
line
in interfaceMeshPartBuilder
-
triangle
public void triangle(short index1, short index2, short index3)
Description copied from interface:MeshPartBuilder
Add a triangle by indices. Requires GL_POINTS, GL_LINES or GL_TRIANGLES primitive type.- Specified by:
triangle
in interfaceMeshPartBuilder
-
triangle
public void triangle(MeshPartBuilder.VertexInfo p1, MeshPartBuilder.VertexInfo p2, MeshPartBuilder.VertexInfo p3)
Description copied from interface:MeshPartBuilder
Add a triangle. Requires GL_POINTS, GL_LINES or GL_TRIANGLES primitive type.- Specified by:
triangle
in interfaceMeshPartBuilder
-
triangle
public void triangle(Vector3 p1, Vector3 p2, Vector3 p3)
Description copied from interface:MeshPartBuilder
Add a triangle. Requires GL_POINTS, GL_LINES or GL_TRIANGLES primitive type.- Specified by:
triangle
in interfaceMeshPartBuilder
-
triangle
public void triangle(Vector3 p1, Color c1, Vector3 p2, Color c2, Vector3 p3, Color c3)
Description copied from interface:MeshPartBuilder
Add a triangle. Requires GL_POINTS, GL_LINES or GL_TRIANGLES primitive type.- Specified by:
triangle
in interfaceMeshPartBuilder
-
rect
public void rect(short corner00, short corner10, short corner11, short corner01)
Description copied from interface:MeshPartBuilder
Add a rectangle by indices. Requires GL_POINTS, GL_LINES or GL_TRIANGLES primitive type.- Specified by:
rect
in interfaceMeshPartBuilder
-
rect
public void rect(MeshPartBuilder.VertexInfo corner00, MeshPartBuilder.VertexInfo corner10, MeshPartBuilder.VertexInfo corner11, MeshPartBuilder.VertexInfo corner01)
Description copied from interface:MeshPartBuilder
Add a rectangle. Requires GL_POINTS, GL_LINES or GL_TRIANGLES primitive type.- Specified by:
rect
in interfaceMeshPartBuilder
-
rect
public void rect(Vector3 corner00, Vector3 corner10, Vector3 corner11, Vector3 corner01, Vector3 normal)
Description copied from interface:MeshPartBuilder
Add a rectangle. Requires GL_POINTS, GL_LINES or GL_TRIANGLES primitive type.- Specified by:
rect
in interfaceMeshPartBuilder
-
rect
public void rect(float x00, float y00, float z00, float x10, float y10, float z10, float x11, float y11, float z11, float x01, float y01, float z01, float normalX, float normalY, float normalZ)
Description copied from interface:MeshPartBuilder
Add a rectangle Requires GL_POINTS, GL_LINES or GL_TRIANGLES primitive type.- Specified by:
rect
in interfaceMeshPartBuilder
-
addMesh
public void addMesh(Mesh mesh)
Description copied from interface:MeshPartBuilder
Copies a mesh to the mesh (part) currently being build.- Specified by:
addMesh
in interfaceMeshPartBuilder
- Parameters:
mesh
- The mesh to copy, must have the same vertex attributes and must be indexed.
-
addMesh
public void addMesh(MeshPart meshpart)
Description copied from interface:MeshPartBuilder
Copies a MeshPart to the mesh (part) currently being build.- Specified by:
addMesh
in interfaceMeshPartBuilder
- Parameters:
meshpart
- The MeshPart to copy, must have the same vertex attributes, primitive type and must be indexed.
-
addMesh
public void addMesh(Mesh mesh, int indexOffset, int numIndices)
Description copied from interface:MeshPartBuilder
Copies a (part of a) mesh to the mesh (part) currently being build.- Specified by:
addMesh
in interfaceMeshPartBuilder
- Parameters:
mesh
- The mesh to (partly) copy, must have the same vertex attributes and must be indexed.indexOffset
- The zero-based offset of the first index of the part of the mesh to copy.numIndices
- The number of indices of the part of the mesh to copy.
-
addMesh
public void addMesh(float[] vertices, short[] indices, int indexOffset, int numIndices)
Description copied from interface:MeshPartBuilder
Copies a (part of a) mesh to the mesh (part) currently being build.- Specified by:
addMesh
in interfaceMeshPartBuilder
- Parameters:
vertices
- The vertices to (partly) copy, must be in the same vertex layout as the mesh being build.indices
- Array containing the indices to (partly) copy, each index should be valid in the vertices array.indexOffset
- The zero-based offset of the first index of the part of indices array to copy.numIndices
- The number of indices of the part of the indices array to copy.
-
addMesh
public void addMesh(float[] vertices, short[] indices)
Description copied from interface:MeshPartBuilder
Copies a mesh to the mesh (part) currently being build. The entire vertices array is added, even if some of the vertices are not indexed by the indices array. If you want to add only the vertices that are actually indexed, then use theMeshPartBuilder.addMesh(float[], short[], int, int)
method instead.- Specified by:
addMesh
in interfaceMeshPartBuilder
- Parameters:
vertices
- The vertices to copy, must be in the same vertex layout as the mesh being build.indices
- Array containing the indices to copy, each index should be valid in the vertices array.
-
patch
@Deprecated public void patch(MeshPartBuilder.VertexInfo corner00, MeshPartBuilder.VertexInfo corner10, MeshPartBuilder.VertexInfo corner11, MeshPartBuilder.VertexInfo corner01, int divisionsU, int divisionsV)
Deprecated.- Specified by:
patch
in interfaceMeshPartBuilder
-
patch
@Deprecated public void patch(Vector3 corner00, Vector3 corner10, Vector3 corner11, Vector3 corner01, Vector3 normal, int divisionsU, int divisionsV)
Deprecated.- Specified by:
patch
in interfaceMeshPartBuilder
-
patch
@Deprecated public void patch(float x00, float y00, float z00, float x10, float y10, float z10, float x11, float y11, float z11, float x01, float y01, float z01, float normalX, float normalY, float normalZ, int divisionsU, int divisionsV)
Deprecated.- Specified by:
patch
in interfaceMeshPartBuilder
-
box
@Deprecated public void box(MeshPartBuilder.VertexInfo corner000, MeshPartBuilder.VertexInfo corner010, MeshPartBuilder.VertexInfo corner100, MeshPartBuilder.VertexInfo corner110, MeshPartBuilder.VertexInfo corner001, MeshPartBuilder.VertexInfo corner011, MeshPartBuilder.VertexInfo corner101, MeshPartBuilder.VertexInfo corner111)
Deprecated.- Specified by:
box
in interfaceMeshPartBuilder
-
box
@Deprecated public void box(Vector3 corner000, Vector3 corner010, Vector3 corner100, Vector3 corner110, Vector3 corner001, Vector3 corner011, Vector3 corner101, Vector3 corner111)
Deprecated.- Specified by:
box
in interfaceMeshPartBuilder
-
box
@Deprecated public void box(Matrix4 transform)
Deprecated.- Specified by:
box
in interfaceMeshPartBuilder
-
box
@Deprecated public void box(float width, float height, float depth)
Deprecated.- Specified by:
box
in interfaceMeshPartBuilder
-
box
@Deprecated public void box(float x, float y, float z, float width, float height, float depth)
Deprecated.- Specified by:
box
in interfaceMeshPartBuilder
-
circle
@Deprecated public void circle(float radius, int divisions, float centerX, float centerY, float centerZ, float normalX, float normalY, float normalZ)
Deprecated.- Specified by:
circle
in interfaceMeshPartBuilder
-
circle
@Deprecated public void circle(float radius, int divisions, Vector3 center, Vector3 normal)
Deprecated.- Specified by:
circle
in interfaceMeshPartBuilder
-
circle
@Deprecated public void circle(float radius, int divisions, Vector3 center, Vector3 normal, Vector3 tangent, Vector3 binormal)
Deprecated.- Specified by:
circle
in interfaceMeshPartBuilder
-
circle
@Deprecated public void circle(float radius, int divisions, float centerX, float centerY, float centerZ, float normalX, float normalY, float normalZ, float tangentX, float tangentY, float tangentZ, float binormalX, float binormalY, float binormalZ)
Deprecated.- Specified by:
circle
in interfaceMeshPartBuilder
-
circle
@Deprecated public void circle(float radius, int divisions, float centerX, float centerY, float centerZ, float normalX, float normalY, float normalZ, float angleFrom, float angleTo)
Deprecated.- Specified by:
circle
in interfaceMeshPartBuilder
-
circle
@Deprecated public void circle(float radius, int divisions, Vector3 center, Vector3 normal, float angleFrom, float angleTo)
Deprecated.- Specified by:
circle
in interfaceMeshPartBuilder
-
circle
@Deprecated public void circle(float radius, int divisions, Vector3 center, Vector3 normal, Vector3 tangent, Vector3 binormal, float angleFrom, float angleTo)
Deprecated.- Specified by:
circle
in interfaceMeshPartBuilder
-
circle
@Deprecated public void circle(float radius, int divisions, float centerX, float centerY, float centerZ, float normalX, float normalY, float normalZ, float tangentX, float tangentY, float tangentZ, float binormalX, float binormalY, float binormalZ, float angleFrom, float angleTo)
Deprecated.- Specified by:
circle
in interfaceMeshPartBuilder
-
ellipse
@Deprecated public void ellipse(float width, float height, int divisions, float centerX, float centerY, float centerZ, float normalX, float normalY, float normalZ)
Deprecated.- Specified by:
ellipse
in interfaceMeshPartBuilder
-
ellipse
@Deprecated public void ellipse(float width, float height, int divisions, Vector3 center, Vector3 normal)
Deprecated.- Specified by:
ellipse
in interfaceMeshPartBuilder
-
ellipse
@Deprecated public void ellipse(float width, float height, int divisions, Vector3 center, Vector3 normal, Vector3 tangent, Vector3 binormal)
Deprecated.- Specified by:
ellipse
in interfaceMeshPartBuilder
-
ellipse
@Deprecated public void ellipse(float width, float height, int divisions, float centerX, float centerY, float centerZ, float normalX, float normalY, float normalZ, float tangentX, float tangentY, float tangentZ, float binormalX, float binormalY, float binormalZ)
Deprecated.- Specified by:
ellipse
in interfaceMeshPartBuilder
-
ellipse
@Deprecated public void ellipse(float width, float height, int divisions, float centerX, float centerY, float centerZ, float normalX, float normalY, float normalZ, float angleFrom, float angleTo)
Deprecated.- Specified by:
ellipse
in interfaceMeshPartBuilder
-
ellipse
@Deprecated public void ellipse(float width, float height, int divisions, Vector3 center, Vector3 normal, float angleFrom, float angleTo)
Deprecated.- Specified by:
ellipse
in interfaceMeshPartBuilder
-
ellipse
@Deprecated public void ellipse(float width, float height, int divisions, Vector3 center, Vector3 normal, Vector3 tangent, Vector3 binormal, float angleFrom, float angleTo)
Deprecated.- Specified by:
ellipse
in interfaceMeshPartBuilder
-
ellipse
@Deprecated public void ellipse(float width, float height, int divisions, float centerX, float centerY, float centerZ, float normalX, float normalY, float normalZ, float tangentX, float tangentY, float tangentZ, float binormalX, float binormalY, float binormalZ, float angleFrom, float angleTo)
Deprecated.- Specified by:
ellipse
in interfaceMeshPartBuilder
-
ellipse
@Deprecated public void ellipse(float width, float height, float innerWidth, float innerHeight, int divisions, Vector3 center, Vector3 normal)
Deprecated.- Specified by:
ellipse
in interfaceMeshPartBuilder
-
ellipse
@Deprecated public void ellipse(float width, float height, float innerWidth, float innerHeight, int divisions, float centerX, float centerY, float centerZ, float normalX, float normalY, float normalZ)
Deprecated.- Specified by:
ellipse
in interfaceMeshPartBuilder
-
ellipse
@Deprecated public void ellipse(float width, float height, float innerWidth, float innerHeight, int divisions, float centerX, float centerY, float centerZ, float normalX, float normalY, float normalZ, float angleFrom, float angleTo)
Deprecated.- Specified by:
ellipse
in interfaceMeshPartBuilder
-
ellipse
@Deprecated public void ellipse(float width, float height, float innerWidth, float innerHeight, int divisions, float centerX, float centerY, float centerZ, float normalX, float normalY, float normalZ, float tangentX, float tangentY, float tangentZ, float binormalX, float binormalY, float binormalZ, float angleFrom, float angleTo)
Deprecated.- Specified by:
ellipse
in interfaceMeshPartBuilder
-
cylinder
@Deprecated public void cylinder(float width, float height, float depth, int divisions)
Deprecated.- Specified by:
cylinder
in interfaceMeshPartBuilder
-
cylinder
@Deprecated public void cylinder(float width, float height, float depth, int divisions, float angleFrom, float angleTo)
Deprecated.- Specified by:
cylinder
in interfaceMeshPartBuilder
-
cylinder
@Deprecated public void cylinder(float width, float height, float depth, int divisions, float angleFrom, float angleTo, boolean close)
Deprecated.- Specified by:
cylinder
in interfaceMeshPartBuilder
-
cone
@Deprecated public void cone(float width, float height, float depth, int divisions)
Deprecated.- Specified by:
cone
in interfaceMeshPartBuilder
-
cone
@Deprecated public void cone(float width, float height, float depth, int divisions, float angleFrom, float angleTo)
Deprecated.- Specified by:
cone
in interfaceMeshPartBuilder
-
sphere
@Deprecated public void sphere(float width, float height, float depth, int divisionsU, int divisionsV)
Deprecated.- Specified by:
sphere
in interfaceMeshPartBuilder
-
sphere
@Deprecated public void sphere(Matrix4 transform, float width, float height, float depth, int divisionsU, int divisionsV)
Deprecated.- Specified by:
sphere
in interfaceMeshPartBuilder
-
sphere
@Deprecated public void sphere(float width, float height, float depth, int divisionsU, int divisionsV, float angleUFrom, float angleUTo, float angleVFrom, float angleVTo)
Deprecated.- Specified by:
sphere
in interfaceMeshPartBuilder
-
sphere
@Deprecated public void sphere(Matrix4 transform, float width, float height, float depth, int divisionsU, int divisionsV, float angleUFrom, float angleUTo, float angleVFrom, float angleVTo)
Deprecated.- Specified by:
sphere
in interfaceMeshPartBuilder
-
capsule
@Deprecated public void capsule(float radius, float height, int divisions)
Deprecated.- Specified by:
capsule
in interfaceMeshPartBuilder
-
arrow
@Deprecated public void arrow(float x1, float y1, float z1, float x2, float y2, float z2, float capLength, float stemThickness, int divisions)
Deprecated.- Specified by:
arrow
in interfaceMeshPartBuilder
-
-