Beispiel #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);
            }
        }
Beispiel #2
0
        private void FixedUpdate()
        {
            if (_vehicleAero == null || !vessel.loaded)
            {
                return;
            }
            if (_vehicleAero.CalculationCompleted)
            {
                _vehicleAero.GetNewAeroData(out _currentAeroModules,
                                            out _unusedAeroModules,
                                            out _currentAeroSections,
                                            out _legacyWingModels);

                Exposure.VesselBounds = _vehicleAero.VoxelBounds;

                if (_flightGUI is null)
                {
                    _flightGUI = vessel.GetComponent <FlightGUI>();
                }

                _flightGUI.UpdateAeroModules(_currentAeroModules, _legacyWingModels);

                foreach (FARAeroPartModule a in _unusedAeroModules)
                {
                    a.SetShielded(true);
                    a.ForceLegacyAeroUpdates();
                }

                foreach (FARAeroPartModule a in _currentAeroModules)
                {
                    a.SetShielded(false);
                    a.ForceLegacyAeroUpdates();
                }

                _vesselIntakeRamDrag.UpdateAeroData(_currentAeroModules);
            }

            if (FlightGlobals.ready && _currentAeroSections != null && vessel)
            {
                CalculateAndApplyVesselAeroProperties();
            }
            if (_currentGeoModules.Count > geoModulesReady)
            {
                CheckGeoModulesReady();
            }
            if (_updateRateLimiter < FARSettingsScenarioModule.VoxelSettings.minPhysTicksPerUpdate)
            {
                _updateRateLimiter++;
            }
            else if (_updateQueued)
            {
                VesselUpdate(_recalcGeoModules);
            }
        }
Beispiel #3
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);
            }
        }