From 0703b548c06084210bb77de0d21ff8b49c366c22 Mon Sep 17 00:00:00 2001 From: gareth Date: Sat, 3 Mar 2007 00:39:16 +0000 Subject: We have a main update loop! --- src/world/Avatar.cs | 4 ++++ src/world/Entity.cs | 4 +++- src/world/PhysicsEngine.cs | 2 ++ src/world/World.cs | 8 ++++++-- 4 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/world/Avatar.cs b/src/world/Avatar.cs index bcf79a8..f3905cd 100644 --- a/src/world/Avatar.cs +++ b/src/world/Avatar.cs @@ -20,6 +20,10 @@ namespace OpenSim.world SetupTemplate("avatar-template.dat"); } + public void update() { + base.update(); + } + private void SetupTemplate(string name) { diff --git a/src/world/Entity.cs b/src/world/Entity.cs index ab07fd6..92ab2da 100644 --- a/src/world/Entity.cs +++ b/src/world/Entity.cs @@ -14,6 +14,7 @@ namespace OpenSim.world protected Quaternion rotation; protected string name; protected List children; + public bool needupdate; public Entity() { @@ -29,7 +30,8 @@ namespace OpenSim.world // Do any per-frame updates needed that are applicable to every type of entity foreach (Entity child in children) { - child.update(); + if(child.needupdate) + child.update(); } } diff --git a/src/world/PhysicsEngine.cs b/src/world/PhysicsEngine.cs index 5bc52de..7585135 100644 --- a/src/world/PhysicsEngine.cs +++ b/src/world/PhysicsEngine.cs @@ -17,5 +17,7 @@ namespace OpenSim.world Console.WriteLine("PhysicsEngine.cs:Startup() - DOING NOTHING, DUMMY FUNCTION!"); } + public void DoStuff(World simworld) { + } } } diff --git a/src/world/World.cs b/src/world/World.cs index f02f73f..dd9b336 100644 --- a/src/world/World.cs +++ b/src/world/World.cs @@ -39,13 +39,17 @@ namespace OpenSim.world } public void DoStuff() { - Thread.Sleep(1000); + physics.DoStuff(this); + this.Update(); } public void Update() { foreach (libsecondlife.LLUUID UUID in Entities.Keys) { - Entities[UUID].update(); + if(Entities[UUID].needupdate) { + Entities[UUID].update(); + } + } } -- cgit v1.1