public EngineWrapper(ModuleEngines engine)
 {
     //init
     thrustController.setMaster(ThrustPI);
     zeroIsp = engine.atmosphereCurve.Evaluate(0f);
     name    = Utils.ParseCamelCase(engine.part.Title());
     if (engine.engineID.Length > 0 && engine.engineID != "Engine")
     {
         name += " (" + engine.engineID + ")";
     }
     //generate engine ID
     this.engine = engine;
     ID          = new EngineID(this);
     //get info
     info = engine.part.Modules.GetModule <TCAEngineInfo>();
     //find gimbal
     gimbal = engine.part.Modules.GetModule <ModuleGimbal>();
 }
Example #2
0
 public EngineWrapper(ModuleEngines engine)
 {
     //generate engine ID
     this.engine = engine;
     name        = Utils.ParseCamelCase(engine.part.Title());
     if (engine.engineID.Length > 0 && engine.engineID != "Engine")
     {
         name += " (" + engine.engineID + ")";
     }
     ID = new EngineID(this);
     //init
     thrustController.setMaster(ThrustPI);
     zeroIsp = GetIsp(0, 0, 0);
     //get info
     info = engine.part.Modules.GetModule <TCAEngineInfo>();
     //find gimbal
     gimbal  = engine.part.Modules.GetModule <ModuleGimbal>();
     gimbals = new List <GimbalInfo>(engine.thrustTransforms.Count);
     if (gimbal != null)
     {
         for (int i = 0, eCount = engine.thrustTransforms.Count; i < eCount; i++)
         {
             var eT = engine.thrustTransforms[i];
             for (int j = 0, gCount = gimbal.gimbalTransforms.Count; j < gCount; j++)
             {
                 var gT = gimbal.gimbalTransforms[j];
                 if (Part.FindTransformInChildrenExplicit(gT, eT))
                 {
                     gimbals.Add(new GimbalInfo(eT, gT, gimbal.initRots[j]));
                     break;
                 }
             }
             if (gimbals.Count == i)
             {
                 gimbals.Add(null);
             }
         }
     }
 }
 public EngineWrapper(ModuleEngines engine)
 {
     //init
     thrustController.setMaster(ThrustPI);
     zeroIsp = engine.atmosphereCurve.Evaluate(0f);
     name = Utils.ParseCamelCase(engine.part.Title());
     if(engine.engineID.Length > 0 && engine.engineID != "Engine")
         name += " (" + engine.engineID + ")";
     //generate engine ID
     this.engine = engine;
     ID = new EngineID(this);
     //get info
     info = engine.part.Modules.GetModule<TCAEngineInfo>();
     //find gimbal
     gimbal = engine.part.Modules.GetModule<ModuleGimbal>();
 }