Exemplo n.º 1
0
    public void Act()
    {
        Quaternion root            = c_physData.q_startRotation;
        Quaternion currentRotation = c_physData.q_startRotation;

        Vector3 spinAxis = Vector3.up;
        Vector3 flipAxis = Vector3.right;

        float currentSpinRate = c_physData.f_currentSpinRate;
        float currentFlipRate = c_physData.f_currentFlipRate;

        float currentSpinDegrees = c_physData.f_currentSpinDegrees;
        float currentFlipDegrees = c_physData.f_currentFlipDegrees;

        HandlingCartridge.Turn(flipAxis, currentFlipDegrees, ref root);
        HandlingCartridge.Turn(spinAxis, currentSpinDegrees, ref root);
        HandlingCartridge.SetRotation(ref currentRotation, root);

        cart_incr.DecrementAbs(ref currentFlipRate, c_physData.f_flipDecay * Time.fixedDeltaTime, 0.0f);
        cart_incr.DecrementAbs(ref currentSpinRate, c_physData.f_spinDecay * Time.fixedDeltaTime, 0.0f);

        c_playerPosData.q_centerOfGravityRotation = currentRotation;
        c_physData.f_currentFlipRate     = currentFlipRate;
        c_physData.f_currentSpinRate     = currentSpinRate;
        c_physData.f_currentSpinDegrees += currentSpinRate * 360f * Time.fixedDeltaTime;
        c_physData.f_currentFlipDegrees += currentFlipRate * 360f * Time.fixedDeltaTime;
    }
Exemplo n.º 2
0
    public void Act()
    {
        Quaternion root            = c_physData.q_startRotation;
        Quaternion currentRotation = c_physData.q_startRotation;

        Vector3 spinAxis = Vector3.up;
        Vector3 flipAxis = Vector3.right;

        float spinCeiling = c_scoringData.f_currentSpinTarget;
        float flipCeiling = c_scoringData.f_currentFlipTarget;

        float currentSpinRate = c_physData.f_currentSpinRate;
        float currentFlipRate = c_physData.f_currentFlipRate;

        float currentSpinDegrees = c_physData.f_currentSpinDegrees;
        float currentFlipDegrees = c_physData.f_currentFlipDegrees;

        HandlingCartridge.Turn(flipAxis, currentFlipDegrees, ref root);
        HandlingCartridge.Turn(spinAxis, currentSpinDegrees, ref root);
        HandlingCartridge.SetRotation(ref currentRotation, root);
        HandlingCartridge.ValidateSpinRotation(currentSpinDegrees, currentFlipDegrees, spinCeiling, flipCeiling, ref currentSpinRate, ref currentFlipRate);

        c_playerPosData.q_centerOfGravityRotation = currentRotation;
        c_physData.f_currentFlipRate     = currentFlipRate;
        c_physData.f_currentSpinRate     = currentSpinRate;
        c_physData.f_currentSpinDegrees += currentSpinRate * 360f * Time.fixedDeltaTime;
        c_physData.f_currentFlipDegrees += currentFlipRate * 360f * Time.fixedDeltaTime;
    }