Class MeshDataPool
- Namespace
- Vintagestory.API.Client
- Assembly
- VintagestoryAPI.dll
This is a modeldata pool, which can hold 400k vertices, 300k indices but not more than 900 chunks
public class MeshDataPool
- Inheritance
-
MeshDataPool
- Inherited Members
- Extension Methods
Fields
AllocatedTris
How many triangles are allocated.
public int AllocatedTris
Field Value
CurrentFragmentation
The current fragmentaton.
public float CurrentFragmentation
Field Value
IndicesPoolSize
the amount of indicies for this pool.
public int IndicesPoolSize
Field Value
MaxPartsPerPool
The maximum parts for this pool.
public int MaxPartsPerPool
Field Value
RenderedTriangles
How many triangles are rendered.
public int RenderedTriangles
Field Value
UsedVertices
How many of the vertices are used.
public int UsedVertices
Field Value
VerticesPoolSize
The current vertices for this pool.
public int VerticesPoolSize
Field Value
indicesGroupsCount
How many index groups are there.
public int indicesGroupsCount
Field Value
indicesPosition
the position of the indices.
public int indicesPosition
Field Value
indicesSizes
The size of each index.
public int[] indicesSizes
Field Value
- int[]
indicesStartsByte
The starting byte for each index.
public int[] indicesStartsByte
Field Value
- int[]
verticesPosition
the position of the vertices.
public int verticesPosition
Field Value
Methods
AllocateNewPool(ICoreClientAPI, int, int, int, CustomMeshDataPartFloat, CustomMeshDataPartShort, CustomMeshDataPartByte, CustomMeshDataPartInt)
Allocates a new pool for mesh data.
public static MeshDataPool AllocateNewPool(ICoreClientAPI capi, int verticesPoolSize, int indicesPoolSize, int maxPartsPerPool, CustomMeshDataPartFloat customFloats = null, CustomMeshDataPartShort customShorts = null, CustomMeshDataPartByte customBytes = null, CustomMeshDataPartInt customInts = null)
Parameters
capi
ICoreClientAPIThe core client API
verticesPoolSize
intThe vertices pool size.
indicesPoolSize
intThe index pool size.
maxPartsPerPool
intThe maximum parts per pool.
customFloats
CustomMeshDataPartFloatThe custom floats of the pool.
customShorts
CustomMeshDataPartShortcustomBytes
CustomMeshDataPartByteThe custom bytes of the pool.
customInts
CustomMeshDataPartIntThe custom ints of the pool.
Returns
- MeshDataPool
The resulting mesh data pool.
CalcFragmentation()
Calculates the current fragmentation of the mesh.
public void CalcFragmentation()
Dispose(ICoreClientAPI)
Disposes of the current mesh pool.
public void Dispose(ICoreClientAPI capi)
Parameters
capi
ICoreClientAPIThe core client API
Draw(ICoreClientAPI, FrustumCulling, EnumFrustumCullMode)
Draw the model.
public void Draw(ICoreClientAPI capi, FrustumCulling frustumCuller, EnumFrustumCullMode frustumCullMode)
Parameters
capi
ICoreClientAPIThe core client API
frustumCuller
FrustumCullingThe area where models can be viewed from the camera.
frustumCullMode
EnumFrustumCullModeThe mode of the culling.
FrustumCull(FrustumCulling, EnumFrustumCullMode)
Cleans up the rendering view of the models.
public void FrustumCull(FrustumCulling frustumCuller, EnumFrustumCullMode frustumCullMode)
Parameters
frustumCuller
FrustumCullingThe area where models can be viewed from the camera.
frustumCullMode
EnumFrustumCullModeThe mode of the culling.
GetFragmentation()
Gets the current fragmentation of the pool.
public float GetFragmentation()
Returns
IsEmpty()
Is this an empty pool.
public bool IsEmpty()
Returns
- bool
true if the pool is empty.
RemoveLocation(ModelDataPoolLocation)
Attempts to remove the model from the pool if the model exists. Will throw an invalid call or an InvalidOperationException if used improperly.
public void RemoveLocation(ModelDataPoolLocation location)
Parameters
location
ModelDataPoolLocationThe location of the model data.
RenderMesh(IRenderAPI)
public void RenderMesh(IRenderAPI render)
Parameters
render
IRenderAPI
SetFullyVisible()
public void SetFullyVisible()
TryAdd(ICoreClientAPI, MeshData, Vec3i, int, Sphere)
Attempts to add the new model.
public ModelDataPoolLocation TryAdd(ICoreClientAPI capi, MeshData modeldata, Vec3i modelOrigin, int dimension, Sphere frustumCullSphere)
Parameters
capi
ICoreClientAPIThe core client API
modeldata
MeshDataThe model to add
modelOrigin
Vec3iThe origin point of the model.
dimension
intfrustumCullSphere
SphereThe culling sphere.
Returns
- ModelDataPoolLocation
The location of the model (and the data) in the pool.