Initializes the simulation.
()
| 30 | * Initializes the simulation. |
| 31 | */ |
| 32 | @Override |
| 33 | public void initialize() { |
| 34 | double dt = control.getDouble("dt"); |
| 35 | double x = control.getDouble("initial x"); |
| 36 | double vx = control.getDouble("initial vx"); |
| 37 | double y = control.getDouble("initial y"); |
| 38 | double vy = control.getDouble("initial vy"); |
| 39 | projectile.setState(x, vx, y, vy); |
| 40 | projectile.setStepSize(dt); |
| 41 | double size = (vx*vx+vy*vy)/10; // estimate of size needed for display |
| 42 | animationFrame.setPreferredMinMax(-1, size, -1, size); |
| 43 | } |
| 44 | |
| 45 | /** |
| 46 | * Does a time step. |
nothing calls this directly
no test coverage detected