protected override void Postprocess()
    {
        Matrix4x4 rightFoot = Actor.GetBoneTransformation(ContactSeries.Bones[3]);
        Matrix4x4 leftFoot  = Actor.GetBoneTransformation(ContactSeries.Bones[4]);

        RightFootIK.Objectives[0].SetTarget(rightFoot.GetPosition(), 1f - ContactSeries.Values[TimeSeries.Pivot][3]);
        RightFootIK.Objectives[0].SetTarget(rightFoot.GetRotation());
        LeftFootIK.Objectives[0].SetTarget(leftFoot.GetPosition(), 1f - ContactSeries.Values[TimeSeries.Pivot][4]);
        LeftFootIK.Objectives[0].SetTarget(leftFoot.GetRotation());
        RightFootIK.Solve();
        LeftFootIK.Solve();

        Transform rightToe = Actor.FindBone("RightToe").Transform;
        Vector3   rightPos = rightToe.transform.position;

        rightPos.y        = Mathf.Max(rightPos.y, 0.02f);
        rightToe.position = rightPos;

        Transform leftToe = Actor.FindBone("LeftToe").Transform;
        Vector3   leftPos = leftToe.transform.position;

        leftPos.y        = Mathf.Max(leftPos.y, 0.02f);
        leftToe.position = leftPos;



        if (WristCorrectionEnabled)
        {
            switch (correctionMethod)
            {
            case CorrectionMethod.Positions:
                CorrectWristsPosition();
                break;

            case CorrectionMethod.Rotations:
                CorrectWrists();
                break;

            case CorrectionMethod.Sensor:
                CorrectWrists1();
                break;

            case CorrectionMethod.None:
                break;
            }
        }
    }
Пример #2
0
    protected override void Postprocess()
    {
        Matrix4x4 rightFoot = Actor.GetBoneTransformation(ContactSeries.Bones[3]);
        Matrix4x4 leftFoot  = Actor.GetBoneTransformation(ContactSeries.Bones[4]);

        RightFootIK.Objectives[0].SetTarget(rightFoot.GetPosition(), 1f - ContactSeries.Values[TimeSeries.Pivot][3]);
        RightFootIK.Objectives[0].SetTarget(rightFoot.GetRotation());
        LeftFootIK.Objectives[0].SetTarget(leftFoot.GetPosition(), 1f - ContactSeries.Values[TimeSeries.Pivot][4]);
        LeftFootIK.Objectives[0].SetTarget(leftFoot.GetRotation());
        RightFootIK.Solve();
        LeftFootIK.Solve();

        Transform rightToe = Actor.FindBone("RightToe").Transform;
        Vector3   rightPos = rightToe.transform.position;

        rightPos.y        = Mathf.Max(rightPos.y, 0.02f);
        rightToe.position = rightPos;

        Transform leftToe = Actor.FindBone("LeftToe").Transform;
        Vector3   leftPos = leftToe.transform.position;

        leftPos.y        = Mathf.Max(leftPos.y, 0.02f);
        leftToe.position = leftPos;
    }