diff options
Diffstat (limited to 'src/graphyx/tests/Stacking.scala')
-rw-r--r-- | src/graphyx/tests/Stacking.scala | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/graphyx/tests/Stacking.scala b/src/graphyx/tests/Stacking.scala new file mode 100644 index 0000000..63734b6 --- /dev/null +++ b/src/graphyx/tests/Stacking.scala @@ -0,0 +1,24 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.tests + +import sims.dynamics._ +import sims.geometry._ + +object Stacking extends Test{ + val world = new World + val title = "Stacking" + def init(): Unit = { + val sideWidth = 0.3 + val sideHeight = 0.2 + val boxes = 5 + val distance = 0.1 + val stack = for (i <- (0 until boxes).toList) yield (new Rectangle(sideWidth / (2 + 0.3 * i), sideHeight / 2, 1) {pos = Vector2D(1, i * (sideHeight + distance))}).asBody + stack(0).fixed = true + for (box <- stack) world += box + } +} |