summaryrefslogtreecommitdiff
path: root/src/graphyx/actors/PhysicsActor.scala
diff options
context:
space:
mode:
Diffstat (limited to 'src/graphyx/actors/PhysicsActor.scala')
-rw-r--r--src/graphyx/actors/PhysicsActor.scala7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/graphyx/actors/PhysicsActor.scala b/src/graphyx/actors/PhysicsActor.scala
index b93541f..0bc7faf 100644
--- a/src/graphyx/actors/PhysicsActor.scala
+++ b/src/graphyx/actors/PhysicsActor.scala
@@ -6,6 +6,7 @@
package graphyx.actors
+import graphyx._
import graphyx.graphics._
import sims.dynamics._
import scala.actors._
@@ -30,8 +31,9 @@ class PhysicsActor extends Actor{
Graphyx.guiActor ! new Scene(world) {override val fps = _fps}
- while (mailboxSize > 0) {
- receive {
+ receiveWithin(0) {
+ case TIMEOUT => ()
+
case Stop => {
simulate = false
println("Simulation stopped.")
@@ -49,7 +51,6 @@ class PhysicsActor extends Actor{
case other => println("Engine received unknown command: '" + other + "'")
}
- }
val h = (System.nanoTime - t0) / 1000000
val f = 60