summaryrefslogtreecommitdiff
path: root/src/main/scala/graphyx/tests/Stacking.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/scala/graphyx/tests/Stacking.scala')
-rw-r--r--src/main/scala/graphyx/tests/Stacking.scala24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/main/scala/graphyx/tests/Stacking.scala b/src/main/scala/graphyx/tests/Stacking.scala
new file mode 100644
index 0000000..63734b6
--- /dev/null
+++ b/src/main/scala/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
+ }
+}