Exemplo n.º 1
0
        public static void InitIKTarget(OCIChar _ociChar, bool _addInfo)
        {
            IKSolverFullBodyBiped solver     = (IKSolverFullBodyBiped)_ociChar.finalIK.solver;
            BipedReferences       references = (BipedReferences)_ociChar.finalIK.references;

            _ociChar.ikCtrl = _ociChar.preparation.IKCtrl;
            AddObjectAssist.AddIKTarget(_ociChar, _ociChar.ikCtrl, 0, solver.get_bodyEffector(), false, (Transform)references.pelvis);
            AddObjectAssist.AddIKTarget(_ociChar, _ociChar.ikCtrl, 1, solver.get_leftShoulderEffector(), false, (Transform)references.leftUpperArm);
            AddObjectAssist.AddIKTarget(_ociChar, _ociChar.ikCtrl, 2, solver.get_leftArmChain(), false, (Transform)references.leftForearm);
            AddObjectAssist.AddIKTarget(_ociChar, _ociChar.ikCtrl, 3, solver.get_leftHandEffector(), true, (Transform)references.leftHand);
            AddObjectAssist.AddIKTarget(_ociChar, _ociChar.ikCtrl, 4, solver.get_rightShoulderEffector(), false, (Transform)references.rightUpperArm);
            AddObjectAssist.AddIKTarget(_ociChar, _ociChar.ikCtrl, 5, solver.get_rightArmChain(), false, (Transform)references.rightForearm);
            AddObjectAssist.AddIKTarget(_ociChar, _ociChar.ikCtrl, 6, solver.get_rightHandEffector(), true, (Transform)references.rightHand);
            AddObjectAssist.AddIKTarget(_ociChar, _ociChar.ikCtrl, 7, solver.get_leftThighEffector(), false, (Transform)references.leftThigh);
            AddObjectAssist.AddIKTarget(_ociChar, _ociChar.ikCtrl, 8, solver.get_leftLegChain(), false, (Transform)references.leftCalf);
            AddObjectAssist.AddIKTarget(_ociChar, _ociChar.ikCtrl, 9, solver.get_leftFootEffector(), true, (Transform)references.leftFoot);
            AddObjectAssist.AddIKTarget(_ociChar, _ociChar.ikCtrl, 10, solver.get_rightThighEffector(), false, (Transform)references.rightThigh);
            AddObjectAssist.AddIKTarget(_ociChar, _ociChar.ikCtrl, 11, solver.get_rightLegChain(), false, (Transform)references.rightCalf);
            AddObjectAssist.AddIKTarget(_ociChar, _ociChar.ikCtrl, 12, solver.get_rightFootEffector(), true, (Transform)references.rightFoot);
            if (!_addInfo)
            {
                return;
            }
            _ociChar.ikCtrl.InitTarget();
        }
Exemplo n.º 2
0
        public IKTargetPair(MotionIK.IKTargetPair.IKTarget target, IKSolverFullBodyBiped solver)
        {
            switch (target)
            {
            case MotionIK.IKTargetPair.IKTarget.LeftHand:
                this.effector = solver.get_leftHandEffector();
                this.bend     = (IKConstraintBend)solver.get_leftArmChain().bendConstraint;
                break;

            case MotionIK.IKTargetPair.IKTarget.RightHand:
                this.effector = solver.get_rightHandEffector();
                this.bend     = (IKConstraintBend)solver.get_rightArmChain().bendConstraint;
                break;

            case MotionIK.IKTargetPair.IKTarget.LeftFoot:
                this.effector = solver.get_leftFootEffector();
                this.bend     = (IKConstraintBend)solver.get_leftLegChain().bendConstraint;
                break;

            case MotionIK.IKTargetPair.IKTarget.RightFoot:
                this.effector = solver.get_rightFootEffector();
                this.bend     = (IKConstraintBend)solver.get_rightLegChain().bendConstraint;
                break;
            }
        }