summaryrefslogtreecommitdiff
path: root/src/graphyx/tests/Restitution.scala
blob: 9501a367a815108e59e7376306d85eb087ccedf1 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
 * Graphyx
 * copyright (c) 2009 Jakob Odersky
 * made available under the MIT License
*/

package graphyx.tests

import sims.geometry._
import sims.dynamics._

object Restitution extends Test{
  val title = "Restitution"
  val world = new World
  
  def init = {
    world += new Body(new Rectangle(1000,0.1,10) {restitution = 1}) {fixed = true}
    world ++= (for (i <- 0 until 10) yield (new Circle(0.05, 10) {pos = Vector2D(i * 0.5, 1); restitution = i / 10.0}).asBody)
  }

}