////////////////////////////////////////////////////////////////////////// // CONSTRUCTORS ////////////////////////////////////////////////////////////////////////// //----------------------------------------------------------------------- public AnimationBone(string name, AnimationSkeleton skeleton) { this.name = name; this.skeleton = skeleton; needsUpdate = true; children = new List<AnimationBone>(); matrixLocalTransform = Matrix.Identity; }
////////////////////////////////////////////////////////////////////////// // CONSTRUCTORS ////////////////////////////////////////////////////////////////////////// //----------------------------------------------------------------------- public AnimationBone(string name, AnimationSkeleton skeleton) { this.name = name; this.skeleton = skeleton; needsUpdate = true; children = new List <AnimationBone>(); matrixLocalTransform = Matrix.Identity; }
public ExampleModelClass(AnimationModelContent model, SkinnedEffect effect) { this.model = model; this.effect = effect; skeleton = model.GetSkeleton(); animationStates = new List<AnimationState>(); for (int i = 0; i < model.GetAnimationCount(); i++) { Animation animation = model.GetAnimation(i); AnimationState state = new AnimationState(animation); animationStates.Add(state); } animationTransforms = new Matrix[skeleton.GetBoneCount()]; }
//----------------------------------------------------------------------- ////////////////////////////////////////////////////////////////////////// // PUBLIC METHODS ////////////////////////////////////////////////////////////////////////// //----------------------------------------------------------------------- public void SetSkeleton(AnimationSkeleton skeleton) { this.skeleton = skeleton; }
private static AnimationSkeleton CreateSkeleton(SerializableSkeleton skeletonContent) { AnimationSkeleton skeleton = new AnimationSkeleton(); SerializableBone rootContent = skeletonContent.rootBone; AnimationBone root = new AnimationBone(rootContent.name, skeleton); root.SetLocalTransform(rootContent.matrixLocalTransform); skeleton.AddBone(root); CreateChildBones(rootContent, root); return skeleton; }