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

Method Ball3DApp

src/csm/ch03/Ball3DApp.java:35–48  ·  view source on GitHub ↗

Constructs Ball3DApp and initializes the drawing.

()

Source from the content-addressed store, hash-verified

33 *
34 */
35 public Ball3DApp() {
36 frame.setPreferredMinMax(-5.0, 5.0, -5.0, 5.0, 0.0, 10.0);
37 ball.setXYZ(0, 0, 9);
38 ball.setSizeXYZ(1, 1, 1); // ball displayed in 3D as a planar ellipse of size (dx,dy,dz)
39 frame.addElement(ball);
40 Element box = new ElementBox();
41 box.setXYZ(0, 0, 0);
42 box.setSizeXYZ(4, 4, 1);
43 box.getStyle().setFillColor(Color.RED);
44 // divide sides of box into smaller rectangles
45 box.getStyle().setResolution(new Resolution(5, 5, 2));
46 frame.addElement(box);
47 frame.setMessage("time = "+ControlUtils.f2(time));
48 }
49
50 /**
51 *

Callers

nothing calls this directly

Calls 9

f2Method · 0.95
setPreferredMinMaxMethod · 0.65
setXYZMethod · 0.65
setSizeXYZMethod · 0.65
addElementMethod · 0.65
setFillColorMethod · 0.65
getStyleMethod · 0.65
setResolutionMethod · 0.65
setMessageMethod · 0.45

Tested by

no test coverage detected