DHART
|
A collection of vertices and indices representing geometry. More...
Public Member Functions | |
int | CalculatePresure () |
Calculates the amount of pressure this mesh should exert on the GC. More... | |
MeshInfo (int[] indices, float[] vertices, string name="", int id=0) | |
Create an instance of MeshInfo from an array of vertices and triangle indices. More... | |
void | RotateMesh (float xrot, float yrot, float zrot) |
Rotate this mesh by the desired magnitude. More... | |
void | RotateMesh (Vector3D rotation) |
Rotate this mesh by the desired magnitude. More... | |
override String | ToString () |
Public Member Functions inherited from DHARTAPI.NativeUtils.NativeObject | |
void | UpdatePressure (int new_pressure) |
Update the pressure of this object. | |
Public Attributes | |
int | id = -1 |
ID of the mesh. | |
string | name = "" |
Name of the mesh. | |
DependentNativeArray< float > | vertices |
An array of all the coordinates for every vertex in the mesh. | |
DependentNativeArray< int > | indices |
An array of the indices for every triangle in the mesh. | |
Public Attributes inherited from DHARTAPI.NativeUtils.NativeObject | |
int | pressure |
the size of the object pointed to in unmanaged memory in bytes. Used to exert pressure on the GC. More... | |
Protected Member Functions | |
override bool | ReleaseHandle () |
Manually delete this mesh in Unmanaged memory. More... | |
Additional Inherited Members | |
Properties inherited from DHARTAPI.NativeUtils.NativeObject | |
override bool | IsInvalid [get] |
There is no way to invalidate this class without destroying it, so will always return false. | |
A collection of vertices and indices representing geometry.
Stores a reference to mesh geometry in native memory. Internally, meshes are represented as a 3 by X matrix of vertices and a 3 by X matrix for indices. In the above image, the face list and vertex list are what's held in MeshInfo's Index and Vertex arrays respectively.
DHARTAPI.Geometry.MeshInfo.MeshInfo | ( | int[] | indices, |
float[] | vertices, | ||
string | name = "" , |
||
int | id = 0 |
||
) |
Create an instance of MeshInfo from an array of vertices and triangle indices.
indices | An array of indices for the triangles in the mesh. Each integer should correspond to 3 values in vertices , and every 3 integers should represent a complete triangle for the mesh. |
vertices | Vertices of the mesh. Each 3 floats represent the X,Y, and Z of a point in space |
name | The name of the mesh. Unused for now. |
id | The unique identifier for this mesh. If -1, this will automatically be set |
DHARTAPI.Exceptions.InvalidMeshException | The input indices and vertices result in an invalid mesh. |
References DHARTAPI.Geometry.MeshInfo.CalculatePresure(), and DHARTAPI.NativeUtils.NativeObject.UpdatePressure().
int DHARTAPI.Geometry.MeshInfo.CalculatePresure | ( | ) |
Calculates the amount of pressure this mesh should exert on the GC.
References DHARTAPI.NativeUtils.NativeArray< T >.size.
Referenced by DHARTAPI.Geometry.MeshInfo.MeshInfo().
|
protected |
Manually delete this mesh in Unmanaged memory.
void DHARTAPI.Geometry.MeshInfo.RotateMesh | ( | float | xrot, |
float | yrot, | ||
float | zrot | ||
) |
Rotate this mesh by the desired magnitude.
xrot | Pitch to rotate by in degrees. |
yrot | Yaw to rotate by in degrees. |
zrot | Roll to rotate by in degrees. |
void DHARTAPI.Geometry.MeshInfo.RotateMesh | ( | Vector3D | rotation | ) |
Rotate this mesh by the desired magnitude.
rotation | How far to rotate the mesh on the X,Y, and Z, axises in degrees. |
References DHARTAPI.NativeUtils.NativeArray< T >.size, and DHARTAPI.Geometry.MeshInfo.vertices.