Click or drag to resize
DigitalRuneMesh Class
Represents a mesh of a 3D model.
Inheritance Hierarchy
SystemObject
  DigitalRune.GraphicsMesh

Namespace: DigitalRune.Graphics
Assembly: DigitalRune.Graphics (in DigitalRune.Graphics.dll) Version: 1.2.0.0 (1.2.1.14562)
Syntax
public class Mesh : INamedObject, IDisposable

The Mesh type exposes the following members.

Constructors
  NameDescription
Public methodMesh
Initializes a new instance of the Mesh class.
Top
Methods
  NameDescription
Public methodDispose
Releases all resources used by an instance of the Mesh class.
Protected methodDispose(Boolean)
Releases the unmanaged resources used by an instance of the Mesh class and optionally releases the managed resources.
Public methodEquals
Determines whether the specified Object is equal to the current Object.
(Inherited from Object.)
Protected methodFinalize
Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection.
(Inherited from Object.)
Public methodGetHashCode
Serves as a hash function for a particular type.
(Inherited from Object.)
Public methodGetType
Gets the Type of the current instance.
(Inherited from Object.)
Protected methodMemberwiseClone
Creates a shallow copy of the current Object.
(Inherited from Object.)
Public methodToString
Returns a string that represents the current object.
(Inherited from Object.)
Top
Extension Methods
  NameDescription
Public Extension MethodGetMorphTargetNames
Gets the names of all morph targets.
(Defined by MeshHelper.)
Public Extension MethodToTriangleMesh
Creates a TriangleMesh from a Mesh.
(Defined by MeshHelper.)
Top
Properties
  NameDescription
Public propertyAnimations
Gets or sets the animations.
Public propertyBoundingShape
Gets or sets the bounding shape of this mesh.
Public propertyMaterials
Gets a collection of materials associated with this mesh.
Public propertyName
Gets or sets the name of this mesh.
Public propertyOccluder
Gets or sets the occluder that is rendered into the occlusion buffer.
Public propertySkeleton
Gets or sets the skeleton for mesh skinning.
Public propertySubmeshes
Gets the collection of Submeshes that make up this mesh. Each submesh is composed of a set of primitives that share the same material.
Public propertyUserData
Gets or sets a user-defined object.
Top
Remarks

A mesh represents the geometry and materials of a 3D object that can be rendered. A mesh owns a collection of Materials and is divided into Submeshes. Each Submesh describes a batch of primitives (usually triangles) that use one material and can be rendered with a single draw call.

The mesh can be rendered by creating a MeshNode and adding it to a 3D scene.

Morph Target Animation: Submeshes may include morph targets (see MorphTargets). The extension method GetMorphTargetNames(Mesh) can be used to get a list of all morph targets included in a mesh. The current MorphWeights are stored in the MeshNode.

Skeletal Animation: The mesh may contain a Skeleton, which can be used to animate (deform) the mesh. The current SkeletonPose is stored in the MeshNode. The property SkeletonPose can be animated. A set of key frame animations can be stored in Animations.

Bounding shape: The bounding shape of the mesh is usually created by the content pipeline and stored in the BoundingShape property. It is not updated automatically when the vertex buffer changes. The user who changes the vertex buffer is responsible for updating or replacing the shape stored in BoundingShape. If the mesh can be deformed on the GPU (e.g. using mesh skinning), then the bounding shape must be large enough to contain all possible deformations.

The properties of the bounding shape can be changed at any time. But it is not allowed to replace the bounding shape while the Mesh is in use, i.e. referenced by a scene node.

For example, if the bounding shape is a SphereShape, the radius of the sphere can be changed at any time. But it is not allowed to replace the SphereShape with a BoxShape as long as the mesh is used in a scene. Replacing the bounding shape will not raise any exceptions, but the mesh may no longer be rendered correctly.

Cloning: Meshes are currently not cloneable.

See Also