Пример #1
0
    void ComputeAngularSpeed(EThrusters _eThusters, EThrusters _eOppositeThusers, float _fDeltaAcceleration, ref float _rfAxisLocalSpeed, ref float _rfAxisLocalAcceleration, float _fPowerMultiplier = 1.0f)
    {
        if (IsThusterEnabled(_eThusters) &&
            !IsThusterEnabled(_eOppositeThusers) &&
            _rfAxisLocalSpeed > -m_fAngularMaxSpeed)
        {
            _rfAxisLocalAcceleration -= m_fAngularAcceleration * m_faThruserPowerRatios[(int)_eThusters] * _fPowerMultiplier;

            // Handbreaking
            if (_rfAxisLocalSpeed > 0.0f)
            {
                _rfAxisLocalSpeed = ComputeDamping(_rfAxisLocalSpeed, _fDeltaAcceleration * m_fAngularHandbreakpower);
            }
        }
        else if (IsThusterEnabled(_eOppositeThusers) &&
                 !IsThusterEnabled(_eThusters) &&
                 _rfAxisLocalSpeed < m_fAngularMaxSpeed)
        {
            _rfAxisLocalAcceleration += m_fAngularAcceleration * m_faThruserPowerRatios[(int)_eOppositeThusers] * _fPowerMultiplier;

            // Handbreaking
            if (_rfAxisLocalSpeed < 0.0f)
            {
                _rfAxisLocalSpeed = ComputeDamping(_rfAxisLocalSpeed, _fDeltaAcceleration * m_fAngularHandbreakpower);
            }
        }
        else if (_rfAxisLocalSpeed != 0.0f)
        {
            _rfAxisLocalSpeed = ComputeDamping(_rfAxisLocalSpeed, _fDeltaAcceleration);
        }
    }
Пример #2
0
 public float GetThustersPowerRatio(EThrusters _eThusters)
 {
     return (m_faThruserPowerRatios[(int)_eThusters]);
 }
Пример #3
0
 public bool IsThusterEnabled(EThrusters _eThuster)
 {
     return (m_baThustersEnabled[(int)_eThuster].Get());
 }
Пример #4
0
 public void SetThrusterEnabled(EThrusters _eThusters, float _bPowerRatio)
 {
     m_baThustersEnabled[(int)_eThusters].Set(_bPowerRatio > 0.0f);
     m_faThruserPowerRatios[(int)_eThusters] = _bPowerRatio;
 }
Пример #5
0
    void ComputeAngularSpeed(EThrusters _eThusters, EThrusters _eOppositeThusers, float _fDeltaAcceleration, ref float _rfAxisLocalSpeed, ref float _rfAxisLocalAcceleration, float _fPowerMultiplier = 1.0f)
    {
        if ( IsThusterEnabled(_eThusters) &&
            !IsThusterEnabled(_eOppositeThusers) &&
             _rfAxisLocalSpeed > -m_fAngularMaxSpeed)
        {
            _rfAxisLocalAcceleration -= m_fAngularAcceleration * m_faThruserPowerRatios[(int)_eThusters] * _fPowerMultiplier;

            // Handbreaking
            if (_rfAxisLocalSpeed > 0.0f)
            {
                _rfAxisLocalSpeed = ComputeDamping(_rfAxisLocalSpeed, _fDeltaAcceleration * m_fAngularHandbreakpower);
            }
        }
        else if (IsThusterEnabled(_eOppositeThusers) &&
                 !IsThusterEnabled(_eThusters) &&
                  _rfAxisLocalSpeed < m_fAngularMaxSpeed)
        {
            _rfAxisLocalAcceleration += m_fAngularAcceleration * m_faThruserPowerRatios[(int)_eOppositeThusers] * _fPowerMultiplier;

            // Handbreaking
            if (_rfAxisLocalSpeed < 0.0f)
            {
                _rfAxisLocalSpeed = ComputeDamping(_rfAxisLocalSpeed, _fDeltaAcceleration * m_fAngularHandbreakpower);
            }
        }
        else if (_rfAxisLocalSpeed != 0.0f)
        {
            _rfAxisLocalSpeed = ComputeDamping(_rfAxisLocalSpeed, _fDeltaAcceleration);
        }
    }
Пример #6
0
 public float GetThustersPowerRatio(EThrusters _eThusters)
 {
     return(m_faThruserPowerRatios[(int)_eThusters]);
 }
Пример #7
0
 public bool IsThusterEnabled(EThrusters _eThuster)
 {
     return(m_baThustersEnabled[(int)_eThuster].Get());
 }
Пример #8
0
 public void SetThrusterEnabled(EThrusters _eThusters, float _bPowerRatio)
 {
     m_baThustersEnabled[(int)_eThusters].Set(_bPowerRatio > 0.0f);
     m_faThruserPowerRatios[(int)_eThusters] = _bPowerRatio;
 }