Package net.risingworld.api.assets
Klasse MeshAsset
java.lang.Object
net.risingworld.api.assets.Asset
net.risingworld.api.assets.MeshAsset
Represents a Mesh which can be populated programmatically. You can set the vertex positions (required), indices (required),
normals (optional), tangents (optional), up to 4 uv channels (optional) and vertex colors (optional).
-
Verschachtelte Klassen - Übersicht
Von Klasse geerbte verschachtelte Klassen/Schnittstellen net.risingworld.api.assets.Asset
Asset.Source, Asset.Type
-
Feldübersicht
Von Klasse geerbte Felder net.risingworld.api.assets.Asset
DEFAULT_EXTENSION
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungvoid
void
addIndex
(int index) Adds a single index.void
addIndices
(int... indices) Adds an arbitrary number of indices.void
addIndices
(ArrayList<Integer> indices) Adds all provided indices.void
void
addNormals
(ArrayList<Vector3f> normals) void
addTangent
(Vector4f tangent) void
addTangents
(ArrayList<Vector4f> tangents) void
addUV
(float u, float v) void
addUV
(int channel, float u, float v) void
void
void
void
addVertex
(float x, float y, float z) void
void
addVertices
(ArrayList<Vector3f> vertices) void
clear()
Clears all mesh data.static MeshAsset
void
ensureCapacity
(int vertexCount, int indexCount) Resizes all internal list to have enough capacity for the given amount of indices and vertices.int
Gets the amount of indices that are currently set (i.e the length of the internal index list).Gets a reference to the internal indices list.int
getUVs
(int channel) int
Gets the amount of vertices that are currently set (i.e the length of the internal vertex list).void
void
setIndices
(ArrayList<Integer> indices) void
setNormals
(ArrayList<Vector3f> normals) void
setTangents
(ArrayList<Vector4f> tangents) void
void
setVertices
(ArrayList<Vector3f> vertices) void
uploadMeshData
(boolean cleanupData) Updates the mesh data, i.e applies all changes that have been done and syncs the new mesh with all playersVon Klasse geerbte Methoden net.risingworld.api.assets.Asset
dispose, equals, getChecksum, getDependency, getExtension, getHandle, getPath, getSource, getType, hashCode, isDisposed
-
Methodendetails
-
create
-
ensureCapacity
public void ensureCapacity(int vertexCount, int indexCount) Resizes all internal list to have enough capacity for the given amount of indices and vertices. The lists get resized automatically when adding new vertices, so this method is mostly for reasons of performance.- Parameter:
vertexCount
- the capacity you want to set for the vertex buffers.indexCount
- the capacity you want to set for the index buffer.
-
getVertexCount
public int getVertexCount()Gets the amount of vertices that are currently set (i.e the length of the internal vertex list).- Gibt zurück:
- the current vertex count.
-
getIndexCount
public int getIndexCount()Gets the amount of indices that are currently set (i.e the length of the internal index list).- Gibt zurück:
- the current indices count.
-
getSubMeshCount
public int getSubMeshCount() -
getIndices
Gets a reference to the internal indices list.- Gibt zurück:
- the internal indices list.
-
getVertices
-
getNormals
-
getTangents
-
getUVs
-
getColors
-
addVertex
public void addVertex(float x, float y, float z) -
addVertex
-
addNormal
-
addTangent
-
addUV
public void addUV(float u, float v) -
addUV
-
addUV
public void addUV(int channel, float u, float v) -
addUV
-
addColor
-
addIndex
public void addIndex(int index) Adds a single index. Winding order is clockwise- Parameter:
index
- the index you want to add.
-
addIndices
public void addIndices(int... indices) Adds an arbitrary number of indices. Winding order is clockwise- Parameter:
indices
- the indices you want to add.
-
addIndices
Adds all provided indices. Winding order is clockwise- Parameter:
indices
- a list containing all indices you want to add.
-
addVertices
-
addNormals
-
addTangents
-
addUVs
-
setIndices
-
setVertices
-
setNormals
-
setTangents
-
setUVs
-
setColors
-
clear
public void clear()Clears all mesh data. -
uploadMeshData
public void uploadMeshData(boolean cleanupData) Updates the mesh data, i.e applies all changes that have been done and syncs the new mesh with all players- Parameter:
cleanupData
- if true, the existing data will also be cleaned up after syncing the new mesh. Set to false if you want to keep the data.
-