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

            children.Add(child);
            Children = new BoneCollection(children);
        }
Example #2
0
 public Bone(int index, string name, Matrix4 transform)
 {
     Index     = index;
     Name      = name;
     Transform = transform;
     Children  = new BoneCollection(new List <Bone>());
 }
Example #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();
 }
Example #4
0
 public void SetParentAndChildren(Bone parent, Bone[] children)
 {
     Parent   = parent;
     Children = new BoneCollection(children);
 }