MCPcopy Create free account
hub / github.com/OpenSourcePhysics/osp / doStep

Method doStep

src/csm/ch03/Ball3DApp.java:55–65  ·  view source on GitHub ↗

Does an animation step by moving the ball.

()

Source from the content-addressed store, hash-verified

53 *
54 */
55 @Override
56protected void doStep() {
57 time += 0.1;
58 double z = ball.getZ()+vz*dt-4.9*dt*dt;
59 vz -= 9.8*dt;
60 if((vz<0)&&(z<1)) {
61 vz = -vz;
62 }
63 ball.setZ(z);
64 frame.setMessage("time = "+ControlUtils.f2(time));
65 }
66
67 /**
68 *

Callers

nothing calls this directly

Calls 4

f2Method · 0.95
getZMethod · 0.65
setZMethod · 0.65
setMessageMethod · 0.45

Tested by

no test coverage detected