diff options
Diffstat (limited to 'src/main/scala/graphyx/Graphyx.scala')
-rw-r--r-- | src/main/scala/graphyx/Graphyx.scala | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/src/main/scala/graphyx/Graphyx.scala b/src/main/scala/graphyx/Graphyx.scala new file mode 100644 index 0000000..17341fb --- /dev/null +++ b/src/main/scala/graphyx/Graphyx.scala @@ -0,0 +1,61 @@ +/* + * Graphyx + * copyright (c) 2009 Jakob Odersky + * made available under the MIT License +*/ + +package graphyx + +import akka.actor._ +import graphyx.actors._ +import graphyx.graphics._ +import graphyx.tests._ +import sims.geometry._ +import sims.dynamics._ + +object Graphyx{ + val tests: List[graphyx.tests.Test] = List( + CompositeShape, + Joints1, + Joints2, + Spring, + Atom, + Chain, + Wave, + Net, + Stacking, + BallStack, + Cup, + Friction, + Friction2, + Restitution, + RagdollTest, + Carriage, + General1, + General2, + Cannon, + EmptyTest + ) + + private var _test: graphyx.tests.Test = tests(0) + def test = _test + def test_=(t: graphyx.tests.Test) = { + t.world.time = 0 + t.world.clear() + t.init() + physicsActor ! SetWorld(t.world) + _test = t + } + + val system = ActorSystem() + val physicsActor = system.actorOf(PhysicsActor(), "physics") + val guiActor = system.actorOf(GUIActor(), "gui") + + def main(args: Array[String]): Unit = { + test = tests(0) + } + + def exit() = { + system.shutdown() + } +} |