Click or drag to resize
Ab4d.SharpEngine logo

TriangleMeshT Class

TriangleMesh class defines the mesh that is created from triangles. Triangles are defined using the data from the TriangleIndices to combine three vertices (defined in Vertices).
Inheritance Hierarchy

Namespace: Ab4d.SharpEngine.Meshes
Assembly: Ab4d.SharpEngine (in Ab4d.SharpEngine.dll) Version: 1.0.8740+deb2991acfe86a95cca780cd4f82bcae2805c1a5
Syntax
C#
public class TriangleMesh<T> : Mesh, 
	IRayHitTestedObject
where T : struct, new(), Object

Type Parameters

T

The TriangleMeshT type exposes the following members.

Constructors
Properties
 NameDescription
Public propertyTriangleIndices Array of integers that defined the triangles (3 consecutive integers defined 3 indexes in the Vertices array that define a triangle).
Public propertyVertices Array of vertices
Top
Methods
 NameDescription
Public methodGetClosestHitResult GetClosestHitResult method returns a RayHitTestResult with the closest triangle hit by the specified ray. When no triangle is hit, null is returned.
Public methodGetDataChannel 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))
Public methodGetDetailsText GetDetailsText method gets string with values of individual vertices and triangle indices of this mesh.
(Overrides MeshGetDetailsText(Boolean, Boolean, Boolean, Int32, Int32, Int32))
Public methodGetNextHitResult 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.
Public methodGetNormals 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).
Public methodGetPositions 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).
Public methodGetTextureCoordinates 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).
Public methodHitTest 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.
Protected methodOnInitializeSceneResources Initializes resources with the specified Scene and GpuDevice. This method can be override and is called from InitializeSceneResources(Scene) method.
(Overrides InitializedSceneComponentOnInitializeSceneResources(Scene, VulkanDevice))
Protected methodOnUpdateMesh OnUpdateMesh
(Overrides MeshOnUpdateMesh(Boolean))
Public methodUpdateBoundingBox UpdateBoundingBox method calculates the BoundingBox from the Vertices.
Top
See Also