Click or drag to resize
AB4D logo

DXMeshGeometry3D Methods

The DXMeshGeometry3D type exposes the following members.

Methods
 NameDescription
Public methodCreateOctTree CreateOctTree returns a MeshOctTree that is created from the mesh defined in this DXMeshGeometry3D. This method must be called after the DXMeshGeometry3D has been initialized (added to DXScene or after InitializeResources method is called).
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 methodGetDetailsText Returns string that tells details about this SceneNode
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 methodStatic memberGetUsedDXMeshGeometry3D GetUsedDXMeshGeometry3D method returns DXMeshGeometry3D that was created from the WPF MeshGeometry3D (or null if no DXMeshGeometry3D was created for the WPF material). parentDXDevice is requireed to check if the created DXMeshGeometry3D was created for the same device.
Public methodGetVertexAndIndexBuffers GetVertexAndIndexBuffers method gets vertex and index buffer array that are created from MeshGeometry3D. This method must be called after the DXMeshGeometry3D was initialized or the Update method was called. Otherwise the returned array will be null.
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 Forces creation of new VertexBuffers and IndexBuffer. This method sets IsVertexBufferDirty and IsIndexBufferDirty to true and then calls Update(Boolean) method.
Public methodStatic memberSetUsedDXMeshGeometry3D Sets a DXMeshGeometry3D that will be used when showing WPF MeshGeometry3D in DXEngine (must be set before the objects are initialized in DXEngine).
Public methodSortTrianglesByCameraDistance SortTrianglesByCameraDistance method sorts the triangle indices so that the triangles are sorted by camera distance - triangles that are farther away are rendered first. After sorting indices, the Update(Boolean) method needs to be called to update the DirectX buffer. When using this method it is highly recommended to set CreateDynamicIndexBuffer to true. See remarks for more info.
Public methodToString Returns a String that represents this instance.
(Overrides ObjectToString)
Public methodUpdate Updates vertex and index buffers based on the IsVertexBufferDirty and IsIndexBufferDirty. To force update both vertex and index buffer call RecreateMesh method. When updateGpuBuffers parameter is false, then the vertex buffer array and index buffer array can be created without a DXDevice object and they will not be sent to the GPU.
Top
See Also