Class Model
A basic 3D model with per mesh parent bones.
public sealed class Model
- Inheritance
-
Model
- Inherited Members
Constructors
Model(GraphicsDevice, List<ModelBone>, List<ModelMesh>)
Constructs a model.
public Model(GraphicsDevice graphicsDevice, List<ModelBone> bones, List<ModelMesh> meshes)
Parameters
graphicsDeviceGraphicsDeviceA valid reference to GraphicsDevice.
bonesList<ModelBone>The collection of bones.
meshesList<ModelMesh>The collection of meshes.
Exceptions
- ArgumentNullException
graphicsDeviceis null.- ArgumentNullException
bonesis null.- ArgumentNullException
meshesis null.
Properties
Bones
A collection of ModelBone objects which describe how each mesh in the mesh collection for this model relates to its parent mesh.
public ModelBoneCollection Bones { get; }
Property Value
Meshes
A collection of ModelMesh objects which compose the model. Each ModelMesh in a model may be moved independently and may be composed of multiple materials identified as ModelMeshPart objects.
public ModelMeshCollection Meshes { get; }
Property Value
Root
Root bone for this model.
public ModelBone Root { get; set; }
Property Value
Tag
Custom attached object.
public object Tag { get; set; }
Property Value
Methods
CopyAbsoluteBoneTransformsTo(Matrix[])
Copies bone transforms relative to all parent bones of the each bone from this model to a given array.
public void CopyAbsoluteBoneTransformsTo(Matrix[] destinationBoneTransforms)
Parameters
destinationBoneTransformsMatrix[]The array receiving the transformed bones.
CopyBoneTransformsFrom(Matrix[])
Copies bone transforms relative to Root bone from a given array to this model.
public void CopyBoneTransformsFrom(Matrix[] sourceBoneTransforms)
Parameters
sourceBoneTransformsMatrix[]The array of prepared bone transform data.
Exceptions
- ArgumentNullException
sourceBoneTransformsis null.- ArgumentOutOfRangeException
sourceBoneTransformsis invalid.
CopyBoneTransformsTo(Matrix[])
Copies bone transforms relative to Root bone from this model to a given array.
public void CopyBoneTransformsTo(Matrix[] destinationBoneTransforms)
Parameters
destinationBoneTransformsMatrix[]The array receiving the transformed bones.
Exceptions
- ArgumentNullException
destinationBoneTransformsis null.- ArgumentOutOfRangeException
destinationBoneTransformsis invalid.
Draw(Matrix, Matrix, Matrix)
Draws the model meshes.
public void Draw(Matrix world, Matrix view, Matrix projection)