Exemple #1
0
        private void FixedUpdate()
        {
            if (_vehicleAero == null)
            {
                return;
            }
            if (_vehicleAero.CalculationCompleted)
            {
                _vehicleAero.GetNewAeroData(out _currentAeroModules, out _unusedAeroModules, out _currentAeroSections, out _legacyWingModels);

                if ((object)_flightGUI == null)
                {
                    _flightGUI = _vessel.GetComponent <FerramAerospaceResearch.FARGUI.FARFlightGUI.FlightGUI>();
                }

                _flightGUI.UpdateAeroModules(_currentAeroModules, _legacyWingModels);
                //Debug.Log("Updating " + _vessel.vesselName + " aero properties\n\rCross-Sectional Area: " + _vehicleAero.MaxCrossSectionArea + " Crit Mach: " + _vehicleAero.CriticalMach + "\n\rUnusedAeroCount: " + _unusedAeroModules.Count + " UsedAeroCount: " + _currentAeroModules.Count + " sectCount: " + _currentAeroSections.Count);

                for (int i = 0; i < _unusedAeroModules.Count; i++)
                {
                    FARAeroPartModule a = _unusedAeroModules[i];
                    a.SetShielded(true);
                    a.ForceLegacyAeroUpdates();
                    //Debug.Log(a.part.partInfo.title + " shielded, area: " + a.ProjectedAreas.totalArea);
                }

                for (int i = 0; i < _currentAeroModules.Count; i++)
                {
                    FARAeroPartModule a = _currentAeroModules[i];
                    a.SetShielded(false);
                    a.ForceLegacyAeroUpdates();
                    //Debug.Log(a.part.partInfo.title + " unshielded, area: " + a.ProjectedAreas.totalArea);
                }

                _vesselIntakeRamDrag.UpdateAeroData(_currentAeroModules, _unusedAeroModules);
            }

            if (FlightGlobals.ready && _currentAeroSections != null && _vessel)
            {
                CalculateAndApplyVesselAeroProperties();
            }


            if (_currentGeoModules.Count > geoModulesReady)
            {
                CheckGeoModulesReady();
            }
            if (_updateRateLimiter < FARSettingsScenarioModule.VoxelSettings.minPhysTicksPerUpdate)
            {
                _updateRateLimiter++;
            }
            else if (_updateQueued)
            {
                VesselUpdate(_recalcGeoModules);
            }
        }
Exemple #2
0
        private void FixedUpdate()
        {
            if (_vehicleAero == null)
            {
                return;
            }
            if (_vehicleAero.CalculationCompleted)
            {
                _vehicleAero.GetNewAeroData(out _currentAeroModules, out _unusedAeroModules, out _currentAeroSections, out _legacyWingModels);

                _vessel.SendMessage("UpdateAeroModules", _currentAeroModules);

                for (int i = 0; i < _unusedAeroModules.Count; i++)
                {
                    FARAeroPartModule a = _unusedAeroModules[i];
                    a.SetShielded(true);
                    //Debug.Log(a.part.partInfo.title + " shielded");
                }

                for (int i = 0; i < _currentAeroModules.Count; i++)
                {
                    FARAeroPartModule a = _currentAeroModules[i];
                    a.SetShielded(false);
                    //Debug.Log(a.part.partInfo.title + " unshielded");
                }

                _vesselIntakeRamDrag.UpdateAeroData(_currentAeroModules, _unusedAeroModules);
            }

            if (FlightGlobals.ready && _currentAeroSections != null)
            {
                CalculateAndApplyVesselAeroProperties();
            }

            if (_currentGeoModules.Count > geoModulesReady)
            {
                CheckGeoModulesReady();
            }
            if (_updateRateLimiter < FARSettingsScenarioModule.VoxelSettings.minPhysTicksPerUpdate)
            {
                _updateRateLimiter++;
            }
            else if (_updateQueued)
            {
                VesselUpdate(_recalcGeoModules);
            }
        }