Beispiel #1
0
        private void UpdateUpstreamValuesFromWingModules(List <FARWingAerodynamicModel> wingModules, List <double> associatedInfluences, double directionalInfluence, double thisWingAoA)
        {
            directionalInfluence = Math.Abs(directionalInfluence);
            for (int i = 0; i < wingModules.Count; i++)
            {
                FARWingAerodynamicModel wingModule = wingModules[i];
                double wingInfluenceFactor         = associatedInfluences[i] * directionalInfluence;

                if (wingModule == null)
                {
                    HandleNullPart(wingModules, associatedInfluences, i);
                    i--;
                    continue;
                }
                if (wingModule.isShielded)
                {
                    continue;
                }

                double tmp = Vector3.Dot(wingModule.transform.forward, parentWingModule.transform.forward);

                effectiveUpstreamMAC  += wingModule.GetMAC() * wingInfluenceFactor;
                effectiveUpstreamb_2  += wingModule.Getb_2() * wingInfluenceFactor;
                effectiveUpstreamArea += wingModule.S * wingInfluenceFactor;

                effectiveUpstreamLiftSlope     += wingModule.GetRawLiftSlope() * wingInfluenceFactor;
                effectiveUpstreamStall         += wingModule.GetStall() * wingInfluenceFactor;
                effectiveUpstreamCosSweepAngle += wingModule.GetCosSweepAngle() * wingInfluenceFactor;
                effectiveUpstreamAoAMax        += wingModule.rawAoAmax * wingInfluenceFactor;
                effectiveUpstreamCd0           += wingModule.GetCd0() * wingInfluenceFactor;
                effectiveUpstreamInfluence     += wingInfluenceFactor;

                double wAoA = wingModule.CalculateAoA(wingModule.GetVelocity()) * Math.Sign(tmp);
                tmp = (thisWingAoA - wAoA) * wingInfluenceFactor;                //First, make sure that the AoA are wrt the same direction; then account for any strange angling of the part that shouldn't be there

                effectiveUpstreamAoA += tmp;
            }
        }