Don't let vertical acceleration be negative before liftoff.
This commit is contained in:
parent
b2bc838e9a
commit
4bfdb5c0e3
@ -348,9 +348,16 @@ public class RK4SimulationStepper extends AbstractSimulationStepper {
|
|||||||
.getCoriolisAcceleration(status.getRocketWorldPosition(), status.getRocketVelocity());
|
.getCoriolisAcceleration(status.getRocketWorldPosition(), status.getRocketVelocity());
|
||||||
linearAcceleration = linearAcceleration.add(store.coriolisAcceleration);
|
linearAcceleration = linearAcceleration.add(store.coriolisAcceleration);
|
||||||
|
|
||||||
|
// If we haven't taken off yet, don't sink into the ground
|
||||||
|
if (!status.isLiftoff()) {
|
||||||
|
angularAcceleration = Coordinate.NUL;
|
||||||
|
if (linearAcceleration.z < 0) {
|
||||||
|
linearAcceleration = Coordinate.ZERO;
|
||||||
|
}
|
||||||
|
} else if (!status.isLaunchRodCleared()) {
|
||||||
|
|
||||||
// If still on the launch rod, project acceleration onto launch rod direction and
|
// If still on the launch rod, project acceleration onto launch rod direction and
|
||||||
// set angular acceleration to zero.
|
// set angular acceleration to zero.
|
||||||
if (!status.isLaunchRodCleared()) {
|
|
||||||
|
|
||||||
linearAcceleration = store.launchRodDirection.multiply(linearAcceleration.dot(store.launchRodDirection));
|
linearAcceleration = store.launchRodDirection.multiply(linearAcceleration.dot(store.launchRodDirection));
|
||||||
angularAcceleration = Coordinate.NUL;
|
angularAcceleration = Coordinate.NUL;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user