Triangle |
public class TriangleMesh<T> : Mesh, IRayHitTestedObject, ITriangularMesh where T : struct, new(), Object
The TriangleMeshT type exposes the following members.
Name | Description | |
---|---|---|
TriangleMeshT(String) | Constructor | |
TriangleMeshT(T, Int32, String) | Constructor | |
TriangleMeshT(T, Int32, BoundingBox, String) | Constructor |
Name | Description | |
---|---|---|
TriangleIndices | Array of integers that define the triangles (3 consecutive integers defined 3 indexes in the Vertices array that define a triangle). When the data in the TriangleIndices array are changed and if this mesh was already initialized ([!:Mesh.IsInitialized] is true) then you need to call UpdateMesh or UpdateMesh(BoundingBox) method for the changes to take effect. When the TriangleIndices property is changed to another array, then UpdateMesh is called automatically. | |
TrianglesCount | Gets the number of triangles that are used to define this mesh. | |
Vertices | Array of vertices of the specified type T. When the data in the Vertices array are changed and if this mesh was already initialized ([!:Mesh.IsInitialized] is true) then you need to call UpdateMesh or UpdateMesh(BoundingBox) method for the changes to take effect. When the Vertices property is changed to another array, then UpdateMesh is called automatically. |
Name | Description | |
---|---|---|
GetClosestHitResult | GetClosestHitResult method returns a RayHitTestResult with the closest triangle hit by the specified ray. When no triangle is hit, null is returned. | |
GetDataChannel |
GetDataChannel returns an object with the data from the specified channel.
For example, for Positions an array of Vector3 is returned with positions defined by this mesh.
Executing this method may take some time because the method may need to create new array objects and copy data from some other data structure (for example an array of PositionNormalTextureVertex values).
(Overrides MeshGetDataChannel(MeshDataChannelTypes)) | |
GetDetailsText |
GetDetailsText method gets string with values of individual vertices and triangle indices of this mesh.
(Overrides MeshGetDetailsText(Boolean, Boolean, Boolean, Int32, Int32, Int32)) | |
GetNextHitResult | GetNextHitResult method continues hit testing from the previously returned hit test and returns a RayHitTestResult with the next hit triangle (not necessary the next closest triangle) or null if no other triangle is hit. This method can be used to get all hit results. | |
GetNormals | Returns an array of Vector3 that define the normals of this mesh. Executing this method may take some time because the method will need to create new array objects and copy data from the original vertices data structure (for example an array of PositionNormalTextureVertex values). | |
GetPositions | Returns an array of Vector3 that define the positions of this mesh. Executing this method may take some time because the method will need to create new array objects and copy data from the original vertices data structure (for example an array of PositionNormalTextureVertex values). | |
GetTextureCoordinates | Returns an array of Vector2 that define the texture coordinates of this mesh. Executing this method may take some time because the method will need to create new array objects and copy data from the original vertices data structure (for example an array of PositionNormalTextureVertex values). | |
GetTrianglePositions | GetTrianglePositions sets the 3 positions that define the triangle with the specified index (max allowed triangleIndex is TrianglesCount - 1). | |
HitTest | HitTest method test the triangles defined in this mesh for hitting with the specified ray. When getOnlyNextHitTest is false, then the closest hit result is returned, else the next hit result is returned. When no hit is found, null is returned. | |
OnInitializeSceneResources |
Initializes resources with the specified Scene and GpuDevice.
This method can be override and is called from InitializeSceneResources(Scene) method.
(Overrides InitializedSceneComponentOnInitializeSceneResources(Scene, VulkanDevice)) | |
OnUpdateMesh |
OnUpdateMesh
(Overrides MeshOnUpdateMesh(Boolean)) | |
UpdateBoundingBox | UpdateBoundingBox method calculates the BoundingBox from the Vertices. |