void Awake() { // Convert from real world units // Rocket engine thrust is given in SI units, so acceleration is in SI units // For Orbital scale need to convert to km/hr^2 accelerationConversion = GravityScaler.AccelSItoGEUnits(); // and convert to the physics scale used in the engine accelerationConversion = accelerationConversion * GravityScaler.AccelGEtoInternalUnits(); burnStart = new double[MAX_STAGES]; burnRateScale = GravityScaler.GetGameSecondPerPhysicsSecond(); fuelLevel = new double[MAX_STAGES]; for (int i = 0; i < numStages; i++) { fuelLevel[i] = massFuel[i]; } // acceleration will be opposite to thrust direction accelDirection = -thrustAxis; activeStage = 0; activeState = GravityEngine.Instance().GetWorldState(); SetEngine(engineOn); }
void Start() { SetEngine(engineOn); // Convert from real world units // Rocket engine thrust is given in SI units, so acceleration is in SI units // For Orbital scale need to convert to km/hr^2 accelerationConversion = GravityScaler.AccelSItoGEUnits(); // and convert to the physics scale used in the engine accelerationConversion = accelerationConversion * GravityScaler.AccelGEtoInternalUnits(); burnRateScaled = burnRate * GravityScaler.GetGameSecondPerPhysicsSecond(); thrustDirection = thrustAxis; }