diff --git a/core/src/main/java/info/openrocket/core/simulation/AbstractSimulationStepper.java b/core/src/main/java/info/openrocket/core/simulation/AbstractSimulationStepper.java index dcd152768..94810fb8e 100644 --- a/core/src/main/java/info/openrocket/core/simulation/AbstractSimulationStepper.java +++ b/core/src/main/java/info/openrocket/core/simulation/AbstractSimulationStepper.java @@ -163,14 +163,12 @@ public abstract class AbstractSimulationStepper implements SimulationStepper { * * @param status the current simulation status. * @param timestep the time step of the current iteration. - * @param acceleration the current (approximate) acceleration - * @param atmosphericConditions the current atmospheric conditions + * @param store the simulation calculation DataStore (contains acceleration, atmosphere) * @param stepMotors whether to step the motors forward or work on a clone object * @return the average thrust during the time step. */ - protected double calculateThrust(SimulationStatus status, - double acceleration, AtmosphericConditions atmosphericConditions, - boolean stepMotors) throws SimulationException { + protected double calculateThrust(SimulationStatus status, DataStore store, + boolean stepMotors) throws SimulationException { double thrust; // Pre-listeners @@ -240,8 +238,6 @@ public abstract class AbstractSimulationStepper implements SimulationStepper { public FlightConditions flightConditions; - public double longitudinalAcceleration = Double.NaN; - public RigidBody rocketMass; public RigidBody motorMass; diff --git a/core/src/main/java/info/openrocket/core/simulation/RK4SimulationStepper.java b/core/src/main/java/info/openrocket/core/simulation/RK4SimulationStepper.java index 91b76d28d..f235da572 100644 --- a/core/src/main/java/info/openrocket/core/simulation/RK4SimulationStepper.java +++ b/core/src/main/java/info/openrocket/core/simulation/RK4SimulationStepper.java @@ -325,7 +325,7 @@ public class RK4SimulationStepper extends AbstractSimulationStepper { double fN = store.forces.getCN() * dynP * refArea; double fSide = store.forces.getCside() * dynP * refArea; - store.thrustForce = calculateThrust(status, store.longitudinalAcceleration, store.flightConditions.getAtmosphericConditions(), false); + store.thrustForce = calculateThrust(status, store, false); double forceZ = store.thrustForce - store.dragForce; store.linearAcceleration = new Coordinate(-fN / store.rocketMass.getMass(),