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