コード例 #1
0
ファイル: Bone.cs プロジェクト: q4a/SparkIV
        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>();
        }
コード例 #2
0
ファイル: Skeleton.cs プロジェクト: q4a/SparkIV
        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);
        }