#region File Description
//-----------------------------------------------------------------------------
// SkinningData.cs
//
// Microsoft XNA Community Game Platform
// Copyright (C) Microsoft Corporation. All rights reserved.
//-----------------------------------------------------------------------------
#endregion
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Content;
namespace CustomModelAnimation
{
///
/// Combines all the data needed to render and animate a skinned object.
/// This is typically stored in the Tag property of the Model being animated.
///
public class ModelData
{
///
/// Gets a collection of animation clips that operate on the root of the object.
/// These are stored by name in a dictionary, so there could for instance be
/// clips for "Walk", "Run", "JumpReallyHigh", etc.
///
[ContentSerializer]
public Dictionary RootAnimationClips { get; private set; }
///
/// Gets a collection of model animation clips. These are stored by name in a
/// dictionary, so there could for instance be clips for "Walk", "Run",
/// "JumpReallyHigh", etc.
///
[ContentSerializer]
public Dictionary ModelAnimationClips { get; private set; }
///
/// Bindpose matrices for each bone in the skeleton,
/// relative to the parent bone.
///
[ContentSerializer]
public List BindPose { get; private set; }
///
/// Vertex to bonespace transforms for each bone in the skeleton.
///
[ContentSerializer]
public List InverseBindPose { get; private set; }
///
/// For each bone in the skeleton, stores the index of the parent bone.
///
[ContentSerializer]
public List SkeletonHierarchy { get; private set; }
///
/// Constructs a new skinning data object.
///
public ModelData(
Dictionary modelAnimationClips,
Dictionary rootAnimationClips,
List bindPose,
List inverseBindPose,
List skeletonHierarchy)
{
ModelAnimationClips = modelAnimationClips;
RootAnimationClips = rootAnimationClips;
BindPose = bindPose;
InverseBindPose = inverseBindPose;
SkeletonHierarchy = skeletonHierarchy;
}
///
/// Private constructor for use by the XNB deserializer.
///
private ModelData()
{
}
}
}