Exemple #1
0
        /*
         * Initiating and setting defaults
         * */
        protected override void OnInitiate()
        {
            // Finding the nodes
            if (parentBone != null)
            {
                boneMapParent.Initiate(parentBone, solver);
            }
            boneMap1.Initiate(bone1, solver);
            boneMap2.Initiate(bone2, solver);
            boneMap3.Initiate(bone3, solver);

            // Define plane points for the bone maps
            boneMap1.SetPlane(boneMap1.node, boneMap2.node, boneMap3.node);
            boneMap2.SetPlane(boneMap2.node, boneMap3.node, boneMap1.node);

            // Find the swing axis for the parent bone
            if (parentBone != null)
            {
                boneMapParent.SetLocalSwingAxis(boneMap1);
            }
        }
Exemple #2
0
        /*
         * Initiating and setting defaults
         * */
        public override void Initiate(IKSolverFullBody solver)
        {
            if (boneMapParent == null)
            {
                boneMapParent = new BoneMap();
            }
            if (boneMap1 == null)
            {
                boneMap1 = new BoneMap();
            }
            if (boneMap2 == null)
            {
                boneMap2 = new BoneMap();
            }
            if (boneMap3 == null)
            {
                boneMap3 = new BoneMap();
            }

            // Finding the nodes
            if (parentBone != null)
            {
                boneMapParent.Initiate(parentBone, solver);
            }
            boneMap1.Initiate(bone1, solver);
            boneMap2.Initiate(bone2, solver);
            boneMap3.Initiate(bone3, solver);

            // Define plane points for the bone maps
            boneMap1.SetPlane(solver, boneMap1.transform, boneMap2.transform, boneMap3.transform);
            boneMap2.SetPlane(solver, boneMap2.transform, boneMap3.transform, boneMap1.transform);

            // Find the swing axis for the parent bone
            if (parentBone != null)
            {
                boneMapParent.SetLocalSwingAxis(boneMap1);
            }
        }