Table of Contents

Class ConstructedMeshInfo

Namespace
NeoVeldrid.Utilities
Assembly
NeoVeldrid.Utilities.dll

A standalone MeshData created from information from an ObjFile.

public class ConstructedMeshInfo : MeshData
Inheritance
ConstructedMeshInfo
Implements
Inherited Members

Constructors

ConstructedMeshInfo(VertexPositionNormalTexture[], ushort[], string)

Constructs a new ConstructedMeshInfo.

public ConstructedMeshInfo(VertexPositionNormalTexture[] vertices, ushort[] indices, string materialName)

Parameters

vertices VertexPositionNormalTexture[]

The vertices.

indices ushort[]

The indices.

materialName string

The name of the associated MTL MaterialDefinition.

Properties

Indices

The indices of the mesh.

public ushort[] Indices { get; }

Property Value

ushort[]

MaterialName

The name of the MaterialDefinition associated with this mesh.

public string MaterialName { get; }

Property Value

string

Vertices

The vertices of the mesh.

public VertexPositionNormalTexture[] Vertices { get; }

Property Value

VertexPositionNormalTexture[]

Methods

CreateIndexBuffer(ResourceFactory, CommandList, out int)

Constructs a DeviceBuffer (index) from this MeshData.

public DeviceBuffer CreateIndexBuffer(ResourceFactory factory, CommandList cl, out int indexCount)

Parameters

factory ResourceFactory

The ResourceFactory to use for device resource creation.

cl CommandList

The CommandList to use for data upload.

indexCount int

Receives the number of indices in the buffer.

Returns

DeviceBuffer

A new index DeviceBuffer.

CreateVertexBuffer(ResourceFactory, CommandList)

Constructs a DeviceBuffer (vertex) from this MeshData.

public DeviceBuffer CreateVertexBuffer(ResourceFactory factory, CommandList cl)

Parameters

factory ResourceFactory

The ResourceFactory to use for device resource creation.

cl CommandList

The 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.

public BoundingBox GetBoundingBox()

Returns

BoundingBox

An axis-aligned BoundingBox.

GetBoundingSphere()

Gets a centered BoundingSphere which completely encapsulates the vertices of this mesh.

public BoundingSphere GetBoundingSphere()

Returns

BoundingSphere

A BoundingSphere.

GetIndices()

Gets an array containing the raw indices of the mesh.

public ushort[] GetIndices()

Returns

ushort[]

An array of indices.

GetVertexPositions()

Gets an array containing the raw vertex positions of the mesh.

public Vector3[] GetVertexPositions()

Returns

Vector3[]

An array of vertex positions.

RayCast(Ray, List<float>)

Performs a RayCast against the vertices of this mesh.

public int RayCast(Ray ray, List<float> distances)

Parameters

ray Ray

The ray to use. This ray should be in object-local space.

distances List<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.

public bool RayCast(Ray ray, out float distance)

Parameters

ray Ray

The ray to use. This ray should be in object-local space.

distance float

If the RayCast is successful, contains the distance from the Ray origin that the hit occurred.

Returns

bool

True if the Ray intersects the mesh; false otherwise