Mesh Class |
Namespace: DigitalRune.Graphics
The Mesh type exposes the following members.
Name | Description | |
---|---|---|
Dispose |
Releases all resources used by an instance of the Mesh class.
| |
Dispose(Boolean) |
Releases the unmanaged resources used by an instance of the Mesh class and
optionally releases the managed resources.
| |
Equals | (Inherited from Object.) | |
Finalize | Allows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.) | |
GetHashCode | Serves as a hash function for a particular type. (Inherited from Object.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
MemberwiseClone | Creates a shallow copy of the current Object. (Inherited from Object.) | |
ToString | Returns a string that represents the current object. (Inherited from Object.) |
Name | Description | |
---|---|---|
GetMorphTargetNames |
Gets the names of all morph targets.
(Defined by MeshHelper.) | |
ToTriangleMesh |
Creates a TriangleMesh from a Mesh.
(Defined by MeshHelper.) |
Name | Description | |
---|---|---|
Animations |
Gets or sets the animations.
| |
BoundingShape |
Gets or sets the bounding shape of this mesh.
| |
Materials |
Gets a collection of materials associated with this mesh.
| |
Name |
Gets or sets the name of this mesh.
| |
Occluder |
Gets or sets the occluder that is rendered into the occlusion buffer.
| |
Skeleton |
Gets or sets the skeleton for mesh skinning.
| |
Submeshes |
Gets the collection of Submeshes that make up this mesh. Each submesh is
composed of a set of primitives that share the same material.
| |
UserData |
Gets or sets a user-defined object.
|
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.