// the part of me that values readability wants these functions out here, the part of me concerned // with performance wants to find a way to inline them - neatness wins for today #region main light intensity calculation methods protected void setIntensityFromExhaust() { //this is how we keep the maths to a minimum jitteredThrottle = throttle + jitterBuffer.getAverage() * jitterMultiplier; // per-frame jitter was annoying, now it's smoothed engineLight.intensity = MINIMUM_LIGHT_INTENSITY + lightPower * jitteredThrottle * jitteredThrottle; // exponential increase in intensity with throttle engineLight.range = minimumLightRange + lightRange * jitteredThrottle; // linear increase in range with throttle }