Interface MeshData
- Namespace
- NeoVeldrid.Utilities
- Assembly
- NeoVeldrid.Utilities.dll
An object describing generic mesh data. This can be used to construct a DeviceBuffer (vertex) and DeviceBuffer (index), and also exposes functionality for bounding box and sphere computation.
public interface MeshData
Methods
CreateIndexBuffer(ResourceFactory, CommandList, out int)
Constructs a DeviceBuffer (index) from this MeshData.
DeviceBuffer CreateIndexBuffer(ResourceFactory factory, CommandList cl, out int indexCount)
Parameters
factoryResourceFactoryThe ResourceFactory to use for device resource creation.
clCommandListThe CommandList to use for data upload.
indexCountintReceives the number of indices in the buffer.
Returns
- DeviceBuffer
A new index DeviceBuffer.
CreateVertexBuffer(ResourceFactory, CommandList)
Constructs a DeviceBuffer (vertex) from this MeshData.
DeviceBuffer CreateVertexBuffer(ResourceFactory factory, CommandList cl)
Parameters
factoryResourceFactoryThe ResourceFactory to use for device resource creation.
clCommandListThe CommandList to use for data upload.
Returns
- DeviceBuffer
A new vertex DeviceBuffer.
GetBoundingBox()
Gets a centered, axis-aligned BoundingBox which completely encapsulates the vertices of this mesh.
BoundingBox GetBoundingBox()
Returns
- BoundingBox
An axis-aligned BoundingBox.
GetBoundingSphere()
Gets a centered BoundingSphere which completely encapsulates the vertices of this mesh.
BoundingSphere GetBoundingSphere()
Returns
GetIndices()
Gets an array containing the raw indices of the mesh.
ushort[] GetIndices()
Returns
- ushort[]
An array of indices.
GetVertexPositions()
Gets an array containing the raw vertex positions of the mesh.
Vector3[] GetVertexPositions()
Returns
- Vector3[]
An array of vertex positions.
RayCast(Ray, List<float>)
Performs a RayCast against the vertices of this mesh.
int RayCast(Ray ray, List<float> distances)
Parameters
rayRayThe ray to use. This ray should be in object-local space.
distancesList<float>All of the distances at which the ray passes through the mesh.
Returns
- int
The number of intersections.
RayCast(Ray, out float)
Performs a RayCast against the vertices of this mesh.
bool RayCast(Ray ray, out float distance)
Parameters
rayRayThe ray to use. This ray should be in object-local space.
distancefloatIf the RayCast is successful, contains the distance from the Ray origin that the hit occurred.