#region License
/* FNA - XNA4 Reimplementation for Desktop Platforms
* Copyright 2009-2016 Ethan Lee and the MonoGame Team
*
* Released under the Microsoft Public License.
* See LICENSE for details.
*/
#endregion
#region Using Statements
using System.Collections.Generic;
#endregion
namespace Microsoft.Xna.Framework.Graphics
{
///
/// Represents bone data for a model.
///
public sealed class ModelBone
{
#region Public Properties
///
/// Gets a collection of bones that are children of this bone.
///
public ModelBoneCollection Children
{
get;
private set;
}
///
/// Gets the index of this bone in the Bones collection.
///
public int Index
{
get;
internal set;
}
///
/// Gets the name of this bone.
///
public string Name
{
get;
internal set;
}
///
/// Gets the parent of this bone.
///
public ModelBone Parent
{
get;
internal set;
}
///
/// Gets or sets the matrix used to transform this bone relative to its parent
/// bone.
///
public Matrix Transform
{
get;
set;
}
#endregion
#region Internal Properties
///
/// Transform of this node from the root of the model not from the parent
///
internal Matrix ModelTransform
{
get;
set;
}
#endregion
#region Private Variables
private List children = new List();
private List meshes = new List();
#endregion
#region Public Constructor
public ModelBone()
{
Children = new ModelBoneCollection(new List());
meshes = new List();
}
#endregion
#region Internal Methods
internal void AddMesh(ModelMesh mesh)
{
meshes.Add(mesh);
}
internal void AddChild(ModelBone modelBone)
{
children.Add(modelBone);
Children = new ModelBoneCollection(children);
}
#endregion
}
}