Merge pull request #721 from JoePfeiffer/fix-718
Assure rocket has left the ground before it is considered as having cleared launch rod
This commit is contained in:
commit
2e14aa8b6a
@ -162,6 +162,7 @@ public class BasicEventSimulationEngine implements SimulationEngine {
|
|||||||
// Avoid sinking into ground before liftoff
|
// Avoid sinking into ground before liftoff
|
||||||
if (relativePosition.z < 0) {
|
if (relativePosition.z < 0) {
|
||||||
currentStatus.setRocketPosition(origin);
|
currentStatus.setRocketPosition(origin);
|
||||||
|
relativePosition = Coordinate.ZERO;
|
||||||
currentStatus.setRocketVelocity(originVelocity);
|
currentStatus.setRocketVelocity(originVelocity);
|
||||||
}
|
}
|
||||||
// Detect lift-off
|
// Detect lift-off
|
||||||
@ -181,7 +182,8 @@ public class BasicEventSimulationEngine implements SimulationEngine {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check for launch guide clearance
|
// Check for launch guide clearance
|
||||||
if (!currentStatus.isLaunchRodCleared() &&
|
if (currentStatus.isLiftoff() &&
|
||||||
|
!currentStatus.isLaunchRodCleared() &&
|
||||||
relativePosition.length() > currentStatus.getSimulationConditions().getLaunchRodLength()) {
|
relativePosition.length() > currentStatus.getSimulationConditions().getLaunchRodLength()) {
|
||||||
addEvent(new FlightEvent(FlightEvent.Type.LAUNCHROD, currentStatus.getSimulationTime(), null));
|
addEvent(new FlightEvent(FlightEvent.Type.LAUNCHROD, currentStatus.getSimulationTime(), null));
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user