void IMS_PropulsionManager::SwitchThrusterMode(THRUSTER_HANDLE thruster, THRUSTERMODE *mode) { //calculate the flowrate so the injector can be updated accordingly, and remove the thruster from its injector double maxmassflow = mode->Thrust / mode->Isp; RemoveThruster(thruster, maxmassflow, false); //get the propper injector for the new mode, or create it if necessary vector<int> &thpropellants = mode->Propellants; vector<float> &thratio = mode->Ratio; double thefficiency = mode->Efficiency; //set new properties for the thruster vessel->SetThrusterIsp(thruster, mode->Isp); vessel->SetThrusterMax0(thruster, mode->Thrust); IMS_PropellantInjector *injector = getInjector(thpropellants, thratio, thefficiency); injector->ConnectThruster(thruster, maxmassflow); }
THRUSTER_HANDLE IMS_PropulsionManager::AddThruster(THRUSTERMODE *thrustermode, VECTOR3 &pos, VECTOR3 &dir) { vector<int> &thpropellants = thrustermode->Propellants; vector<float> &thratio = thrustermode->Ratio; double thefficiency = thrustermode->Efficiency; //calculate position relative to CoG VECTOR3 finalpos = pos + vessel->GetCoGmanager()->GetCoG(); THRUSTER_HANDLE newthruster = vessel->CreateThruster(pos, dir, thrustermode->Thrust, NULL, thrustermode->Isp); double maxmassflow = thrustermode->Thrust / thrustermode->Isp; //get a compatible injector, or create one if there isn't IMS_PropellantInjector *injector = getInjector(thpropellants, thratio, thefficiency); injector->ConnectThruster(newthruster, maxmassflow); //add exhausts to the thruster return newthruster; }
int main(int argc, char *argv[]) { return getInjector()->get<ShaderTool>()->startMainLoop(argc, argv); }
int main(int argc, char *argv[]) { getInjector()->get<Client>()->startMainLoop(argc, argv); return EXIT_SUCCESS; }