diff options
Diffstat (limited to 'src/world/World.cs')
-rw-r--r-- | src/world/World.cs | 30 |
1 files changed, 2 insertions, 28 deletions
diff --git a/src/world/World.cs b/src/world/World.cs index 920220f..ebbd61e 100644 --- a/src/world/World.cs +++ b/src/world/World.cs | |||
@@ -3,7 +3,6 @@ using libsecondlife; | |||
3 | using libsecondlife.Packets; | 3 | using libsecondlife.Packets; |
4 | using System.Collections.Generic; | 4 | using System.Collections.Generic; |
5 | using System.Text; | 5 | using System.Text; |
6 | using PhysicsManager; | ||
7 | 6 | ||
8 | namespace OpenSim.world | 7 | namespace OpenSim.world |
9 | { | 8 | { |
@@ -14,8 +13,6 @@ namespace OpenSim.world | |||
14 | public ScriptEngine Scripts; | 13 | public ScriptEngine Scripts; |
15 | public TerrainDecode terrainengine = new TerrainDecode(); | 14 | public TerrainDecode terrainengine = new TerrainDecode(); |
16 | public uint _localNumber=0; | 15 | public uint _localNumber=0; |
17 | private PhysicsScene phyScene; | ||
18 | private float timeStep= 0.1f; | ||
19 | 16 | ||
20 | private Random Rand = new Random(); | 17 | private Random Rand = new Random(); |
21 | 18 | ||
@@ -35,30 +32,9 @@ namespace OpenSim.world | |||
35 | // Initialise this only after the world has loaded | 32 | // Initialise this only after the world has loaded |
36 | Scripts = new ScriptEngine(this); | 33 | Scripts = new ScriptEngine(this); |
37 | } | 34 | } |
38 | 35 | ||
39 | public PhysicsScene PhysScene | ||
40 | { | ||
41 | set | ||
42 | { | ||
43 | this.phyScene = value; | ||
44 | } | ||
45 | } | ||
46 | |||
47 | public void Update() | 36 | public void Update() |
48 | { | 37 | { |
49 | if(this.phyScene.IsThreaded) | ||
50 | { | ||
51 | this.phyScene.GetResults(); | ||
52 | |||
53 | } | ||
54 | |||
55 | foreach (libsecondlife.LLUUID UUID in Entities.Keys) | ||
56 | { | ||
57 | Entities[UUID].addFroces(); | ||
58 | } | ||
59 | |||
60 | this.phyScene.Simulate(timeStep); | ||
61 | |||
62 | foreach (libsecondlife.LLUUID UUID in Entities.Keys) | 38 | foreach (libsecondlife.LLUUID UUID in Entities.Keys) |
63 | { | 39 | { |
64 | Entities[UUID].update(); | 40 | Entities[UUID].update(); |
@@ -79,9 +55,7 @@ namespace OpenSim.world | |||
79 | this.Entities.Add(AgentClient.AgentID, NewAvatar); | 55 | this.Entities.Add(AgentClient.AgentID, NewAvatar); |
80 | Console.WriteLine("World.cs:AddViewerAgent() - Starting RegionHandshake "); | 56 | Console.WriteLine("World.cs:AddViewerAgent() - Starting RegionHandshake "); |
81 | NewAvatar.SendRegionHandshake(this); | 57 | NewAvatar.SendRegionHandshake(this); |
82 | 58 | this.Update(); // will work for now, but needs to be optimised so we don't update everything in the sim for each new user | |
83 | NewAvatar.PhysActor = this.phyScene.AddAvatar(new PhysicsVector(NewAvatar.position.x, NewAvatar.position.y, NewAvatar.position.z)); | ||
84 | //this.Update(); // will work for now, but needs to be optimised so we don't update everything in the sim for each new user | ||
85 | } | 59 | } |
86 | 60 | ||
87 | public bool Backup() { | 61 | public bool Backup() { |