From 01c5c700647feba596e02cb7a2e672f5301504ff Mon Sep 17 00:00:00 2001 From: Jakob Odersky Date: Mon, 29 Jun 2015 12:32:00 +0200 Subject: Port to scala 2.11 --- src/main/scala/graphyx/tests/Friction2.scala | 33 ++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/main/scala/graphyx/tests/Friction2.scala (limited to 'src/main/scala/graphyx/tests/Friction2.scala') diff --git a/src/main/scala/graphyx/tests/Friction2.scala b/src/main/scala/graphyx/tests/Friction2.scala new file mode 100644 index 0000000..5204fcf --- /dev/null +++ b/src/main/scala/graphyx/tests/Friction2.scala @@ -0,0 +1,33 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx.tests + +import sims.geometry._ +import sims.dynamics._ +import sims.dynamics.joints._ + +object Friction2 extends Test{ + val title = "Friction2" + val world = new World {override val detector = new sims.collision.GridDetector(this) {gridSide = 0.2}} + + def init = { + val shapes = for (i <- (0 to 20).toList) yield (new Rectangle(0.2, 0.1, 1) { + pos = Vector2D(0.4 * i, 0) + friction = (i * 1.0 / 10) + restitution = 0 + }) + val ground = new Body(shapes: _*) + ground.pos = Vector2D(0,0) + ground.fixed = true + ground.rotation = -math.Pi / 5 + world += ground + + val b: Body = (new Circle(0.1,10)) ~ (new Circle(0.1,10) {pos = Vector2D(0.2,0)}) ~ (new Circle(0.1,10) {pos = Vector2D(0.4,0)}) + b.pos = Vector2D(0.1,0.1) + world += b + } +} -- cgit v1.2.3