We have a main update loop!
parent
808fdcc915
commit
0703b548c0
|
@ -20,6 +20,10 @@ namespace OpenSim.world
|
|||
SetupTemplate("avatar-template.dat");
|
||||
}
|
||||
|
||||
public void update() {
|
||||
base.update();
|
||||
}
|
||||
|
||||
private void SetupTemplate(string name)
|
||||
{
|
||||
|
||||
|
|
|
@ -14,6 +14,7 @@ namespace OpenSim.world
|
|||
protected Quaternion rotation;
|
||||
protected string name;
|
||||
protected List<Entity> 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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -17,5 +17,7 @@ namespace OpenSim.world
|
|||
Console.WriteLine("PhysicsEngine.cs:Startup() - DOING NOTHING, DUMMY FUNCTION!");
|
||||
}
|
||||
|
||||
public void DoStuff(World simworld) {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue