示例#1
0
文件: AJERotor.cs 项目: ysdavy/AJE
        public override void CreateEngine()
        {
            if (maxEngineTemp == 0d)
            {
                maxEngineTemp = part.maxTemp;
            }

            float omega = rpm * 0.1047f;

            engineSolver = new SolverRotor(omega, r, weight, power * 745.7f, 1.2f, VTOLbuff, BSFC, useOxygen, reverseRotation ? -clockWise : clockWise);


            useAtmCurve = atmChangeFlow = useVelCurve = useAtmCurveIsp = useVelCurveIsp = false;

            thrustTransformVectorDefault = thrustTransforms[0].forward;

            /*this.Fields["Yaw Coeff."].guiActive = yaw;
             * this.Fields["Yaw Coeff."].guiActiveEditor = yaw;
             * this.Fields["Collective Diff. Pitch Coeff."].guiActive = colDiffPitch;
             * this.Fields["Collective Diff. Pitch Coeff."].guiActiveEditor = colDiffPitch;
             * this.Fields["Cyclic Diff. Coeff."].guiActive = cycDiffYaw;
             * this.Fields["Cyclic Diff. Coeff."].guiActiveEditor = cycDiffYaw;*/
            rollPID  = new PIDController((int)(1 / Time.fixedDeltaTime));
            pitchPID = new PIDController((int)(1 / Time.fixedDeltaTime));
        }
示例#2
0
        public override void OnStart(StartState state)
        {
            if (state == StartState.Editor)
            {
                return;
            }
            if (vessel == null)
            {
                return;
            }

            float omega = rpm * 0.1047f;

            takeoffLift = power * 745.7f / omega / r; //in newton
            yawPID1     = new PIDController((int)(1 / Time.fixedDeltaTime));
            yawPID2     = new PIDController((int)(1 / Time.fixedDeltaTime));
            t           = part.FindModelTransform(thrustVectorTransformName);
            smoothinput = new SmoothInput(0.5f);
        }