Beispiel #1
0
        /// <summary>
        /// Constructs a new animation player.
        /// </summary>
        public AnimationPlayer(SkinningData skinningData)
        {
            if (skinningData == null)
                throw new ArgumentNullException("skinningData");

            skinningDataValue = skinningData;

            boneTransforms = new Matrix[skinningData.BindPose.Count];
            worldTransforms = new Matrix[skinningData.BindPose.Count];
            skinTransforms = new Matrix[skinningData.BindPose.Count];
        }
Beispiel #2
0
        /// <param name="modelName">Name of model stored in model database at startup.</param>
        public AnimateModel(string modelName, string defaultAnimation)
            : base(modelName, typeof(AnimateModelRenderer))
        {
            mSkinningData = AssetLibrary.LookupModelSkinningData(Name + mAnimationName);
            if (mSkinningData == null)
            {
                throw new Exception("This model does not contain skinningData.");
            }

            mAnimationPlayer = new AnimationPlayer(mSkinningData);

            PlayAnimation(defaultAnimation, false);
        }