示例#1
0
        public void AddChild(Bone child)
        {
            List <Bone> children = Children.ToList();

            children.Add(child);
            Children = new BoneCollection(children);
        }
示例#2
0
 public Bone(int index, string name, Matrix4 transform)
 {
     Index     = index;
     Name      = name;
     Transform = transform;
     Children  = new BoneCollection(new List <Bone>());
 }
示例#3
0
 public Skeleton(IList <Bone> bones, int skeletonRoot = -1, IList <Matrix4> inverseAbsoluteBindPose = null)
 {
     if (skeletonRoot >= 0 && inverseAbsoluteBindPose == null)
     {
         throw new ArgumentException("inverseAsoluteBindPose must be non null is skeletonRoot is >= 0.");
     }
     _bones       = new BoneCollection(bones);
     SkeletonRoot = skeletonRoot;
     if (inverseAbsoluteBindPose != null)
     {
         InverseAbsoluteBindPose = new ReadOnlyCollection <Matrix4>(inverseAbsoluteBindPose);
     }
     _boneTransforms = _bones.Select(b => b.Transform).ToArray();
 }
示例#4
0
 public void SetParentAndChildren(Bone parent, Bone[] children)
 {
     Parent   = parent;
     Children = new BoneCollection(children);
 }