Exemple #1
0
        internal Bone(Resource.Skeletons.Bone bone, Bone parent)
        {
            Parent = parent;
            Name   = bone.Name;
            Index  = bone.BoneIndex;

            Position = bone.Position;
            Rotation = bone.RotationEuler;

            AbsolutePosition = bone.AbsolutePosition;
            AbsoluteRotation = bone.AbsoluteRotationEuler;

            Children = new List <Bone>();
        }
Exemple #2
0
        private Bone BuildBone(Resource.Skeletons.Bone bone, Bone parent)
        {
            var dataBone = new Bone(bone, parent);

            _bonesByIndex.Add(dataBone.Index, dataBone);

            var childBone = bone.FirstChild;

            while (childBone != null)
            {
                dataBone.Children.Add(BuildBone(childBone, dataBone));
                childBone = childBone.NextSibling;
            }

            return(dataBone);
        }