public void AddBone(BoneCache bone, bool worldPositionStays)
        {
            Debug.Assert(bone != null);
            Debug.Assert(!Contains(bone));

            if (bone.parent == null)
            {
                bone.SetParent(this, worldPositionStays);
            }

            m_Bones.Add(bone);
        }
Example #2
0
        public void SetBoneParent(BoneCache newParent, BoneCache bone)
        {
            TransformCache parent = newParent;

            if (newParent == null)
            {
                parent = bone.skeleton;
            }

            skinningCache.RestoreBindPose();
            bone.SetParent(parent, true);
            bone.SetDefaultPose();
        }
Example #3
0
        public void SetBoneParent(BoneCache newParent, BoneCache bone, int insertAtIndex)
        {
            TransformCache parent = newParent;

            if (newParent == null)
                parent = bone.skeleton;

            skinningCache.RestoreBindPose();
            bone.SetParent(parent, true);

            if (insertAtIndex == -1)
                insertAtIndex = parent.ChildCount;

            bone.siblingIndex = insertAtIndex;
            bone.SetDefaultPose();
        }