Click or drag to resize
AB4D logo

GeometryMesh Class

GeometryMesh class is used to create Index and Vertex buffers from list of positions, normals, textureCoordinates and triangleIndices.
Inheritance Hierarchy
SystemObject
  Ab3d.DirectXDXResourceBase
    Ab3d.DirectXSharedDXResource
      Ab3d.DirectXSharedDXDeviceResource
        Ab3d.DirectXMeshBase
          Ab3d.DirectXGeometryMesh

Namespace: Ab3d.DirectX
Assembly: Ab3d.DXEngine (in Ab3d.DXEngine.dll) Version: 7.0.8865.1045
Syntax
C#
public class GeometryMesh : MeshBase, 
	IRayHitTestedObject, ITriangularMesh, IOctTreeMesh

The GeometryMesh type exposes the following members.

Constructors
Properties
 NameDescription
Public propertyNormals Gets or sets IList of Vector3 that represents the Normals. When this property is changed, the RecreateMesh method must be called.
Public propertyOctTree Gets or sets an MeshOctTree that can be used for hit testing. The MeshOctTree is automatically generated when number of positions in this mesh is bigger or equal to the value set in MeshPositionsCountForOctTreeGeneration.
Public propertyPositions Gets or sets IList of Vector3 that represents the Positions. When this property is changed, the RecreateMesh method must be called.
Public propertyTextureCoordinates Gets or sets IList of Vector2 that represents the TextureCoordinates. When this property is changed, the RecreateMesh method must be called.
Public propertyTriangleIndices Gets or sets IList of ints that represents the triangle indices. When this property is changed, the RecreateMesh method must be called.
Public propertyTrianglesCount Gets the number of triangles that are used to define this mesh.
Top
Methods
 NameDescription
Public methodCreateOctTree CreateOctTree returns a MeshOctTree that is created from the mesh defined in this GeometryMesh.
Public methodGetClosestHitResult GetClosestHitResult method returns a DXRayHitTestResult with the closest triangle hit by the specified ray. When no triangle is hit, null is returned.
Public methodGetNextHitResult GetNextHitResult method continues hit testing from the previously returned hit test and returns a DXRayHitTestResult 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 methodGetTrianglePositions GetTrianglePositions sets the 3 positions that define the triangle with the specified triangle index.
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.
Public methodRecreateMesh RecreateMesh disposes the existing VertexBuffers and IndexBuffer and recreates the buffers.
Public methodUpdateBounds Updates the Bounds of this mesh
Top
See Also