コード例 #1
0
    public void Act()
    {
        float vertVelocity = c_aerialMoveData.f_verticalVelocity;
        float latVelocity  = c_aerialMoveData.f_lateralVelocity;

        float gravity          = c_playerData.f_gravity;
        float terminalVelocity = c_playerData.f_terminalVelocity;

        Vector3 lateralDir = c_aerialMoveData.v_lateralDirection;
        Vector3 playerPos  = c_playerData.v_currentPosition;

        GravityCartridge.UpdateAirVelocity(ref vertVelocity, gravity, terminalVelocity);
        VelocityCartridge.UpdateAerialPosition(ref playerPos, lateralDir, vertVelocity, latVelocity);

        if (vertVelocity <= Constants.ZERO_F)
        {
            c_playerData.f_currentRaycastDistance = c_playerData.f_raycastDistance + Mathf.Abs(vertVelocity) * Time.fixedDeltaTime;
        }
        else
        {
            c_playerData.f_currentRaycastDistance = Constants.ZERO_F;
        }

        c_playerData.v_currentPosition      = playerPos;
        c_aerialMoveData.f_verticalVelocity = vertVelocity;
    }
コード例 #2
0
    public void Act()
    {
        // check for angle when implemented
        float      currentVelocity = c_playerData.f_currentSpeed;
        float      deceleration    = c_playerData.f_brakePower;
        float      slowScaling     = c_playerInputData.f_inputAxisLVert * -1;
        Vector3    currentPosition = c_playerData.v_currentPosition;
        Vector3    currentNormal   = c_playerData.v_currentNormal;
        Quaternion currentRotation = c_playerData.q_currentRotation;

        AccelerationCartridge.Decelerate(ref currentVelocity,
                                         deceleration * slowScaling);

        AccelerationCartridge.DecelerateFriction(ref currentVelocity,
                                                 0.1f,
                                                 currentRotation);

        VelocityCartridge.UpdatePositionTwo(ref currentPosition, ref currentRotation, ref currentVelocity);

        c_playerData.f_currentSpeed    = currentVelocity;
        c_playerData.v_currentPosition = currentPosition;
        c_playerData.v_currentNormal   = currentNormal.normalized;
        c_playerData.v_currentDown     = currentNormal.normalized * -1;
        c_playerData.q_currentRotation = currentRotation;
    }
コード例 #3
0
    public void Act()
    {
        int     i = c_activeData.i_currentPreviewIndex;
        Vector3 currentPosition = c_positionData.v_currentPosition;

        VelocityCartridge.LerpPosition(ref currentPosition,
                                       c_previewData.PreviewShots[i].StartPosition,
                                       c_previewData.PreviewShots[i].EndPosition,
                                       c_activeData.f_currentShotTime / c_previewData.PreviewShots[i].Time);

        c_activeData.f_currentShotTime  += Time.deltaTime;
        c_positionData.v_currentPosition = currentPosition;
    }
コード例 #4
0
    public void Act()
    {
        // check for angle when implemented
        float      currentVelocity      = c_playerData.f_currentSpeed;
        Vector3    currentPosition      = c_playerData.v_currentPosition;
        Quaternion currentRotation      = c_playerData.q_currentRotation;
        Quaternion currentModelRotation = c_playerPositionData.q_currentModelRotation;

        AccelerationCartridge.AccelerateGravity(ref currentVelocity,
                                                c_playerData.f_gravity,
                                                c_playerData.f_topSpeed,
                                                ref currentRotation,
                                                ref currentModelRotation);

        AccelerationCartridge.DecelerateFriction(ref currentVelocity,
                                                 0.1f,
                                                 currentRotation);

        VelocityCartridge.UpdatePositionTwo(ref currentPosition, ref currentRotation, ref currentVelocity);

        c_playerData.f_currentSpeed    = currentVelocity;
        c_playerData.v_currentPosition = currentPosition;
        c_playerData.q_currentRotation = currentRotation;
    }