aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Tests/Common/Helpers/SceneHelpers.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Tests/Common/Helpers/SceneHelpers.cs28
1 files changed, 25 insertions, 3 deletions
diff --git a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs
index b368822..5cd5b88 100644
--- a/OpenSim/Tests/Common/Helpers/SceneHelpers.cs
+++ b/OpenSim/Tests/Common/Helpers/SceneHelpers.cs
@@ -32,11 +32,11 @@ using Nini.Config;
32using OpenMetaverse; 32using OpenMetaverse;
33using OpenSim.Data.Null; 33using OpenSim.Data.Null;
34using OpenSim.Framework; 34using OpenSim.Framework;
35using OpenSim.Framework.Communications; 35
36using OpenSim.Framework.Console; 36using OpenSim.Framework.Console;
37using OpenSim.Framework.Servers; 37using OpenSim.Framework.Servers;
38using OpenSim.Framework.Servers.HttpServer; 38using OpenSim.Framework.Servers.HttpServer;
39using OpenSim.Region.Physics.Manager; 39using OpenSim.Region.PhysicsModules.SharedBase;
40using OpenSim.Region.Framework; 40using OpenSim.Region.Framework;
41using OpenSim.Region.Framework.Interfaces; 41using OpenSim.Region.Framework.Interfaces;
42using OpenSim.Region.Framework.Scenes; 42using OpenSim.Region.Framework.Scenes;
@@ -48,6 +48,7 @@ using OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory;
48using OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid; 48using OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid;
49using OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts; 49using OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts;
50using OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence; 50using OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence;
51using OpenSim.Region.PhysicsModule.BasicPhysics;
51using OpenSim.Services.Interfaces; 52using OpenSim.Services.Interfaces;
52using GridRegion = OpenSim.Services.Interfaces.GridRegion; 53using GridRegion = OpenSim.Services.Interfaces.GridRegion;
53 54
@@ -77,6 +78,8 @@ namespace OpenSim.Tests.Common
77 78
78 private CoreAssetCache m_cache; 79 private CoreAssetCache m_cache;
79 80
81 private PhysicsScene m_physicsScene;
82
80 public SceneHelpers() : this(null) {} 83 public SceneHelpers() : this(null) {}
81 84
82 public SceneHelpers(CoreAssetCache cache) 85 public SceneHelpers(CoreAssetCache cache)
@@ -97,6 +100,8 @@ namespace OpenSim.Tests.Common
97 100
98 m_cache = cache; 101 m_cache = cache;
99 102
103 m_physicsScene = StartPhysicsScene();
104
100 SimDataService 105 SimDataService
101 = OpenSim.Server.Base.ServerUtils.LoadPlugin<ISimulationDataService>("OpenSim.Tests.Common.dll", null); 106 = OpenSim.Server.Base.ServerUtils.LoadPlugin<ISimulationDataService>("OpenSim.Tests.Common.dll", null);
102 } 107 }
@@ -158,12 +163,16 @@ namespace OpenSim.Tests.Common
158 "basicphysics", "ZeroMesher", new IniConfigSource(), "test", regionExtent); 163 "basicphysics", "ZeroMesher", new IniConfigSource(), "test", regionExtent);
159 164
160 TestScene testScene = new TestScene( 165 TestScene testScene = new TestScene(
161 regInfo, m_acm, physicsScene, scs, SimDataService, m_estateDataService, configSource, null); 166 regInfo, m_acm, SimDataService, m_estateDataService, configSource, null);
162 167
163 INonSharedRegionModule godsModule = new GodsModule(); 168 INonSharedRegionModule godsModule = new GodsModule();
164 godsModule.Initialise(new IniConfigSource()); 169 godsModule.Initialise(new IniConfigSource());
165 godsModule.AddRegion(testScene); 170 godsModule.AddRegion(testScene);
166 171
172 // Add scene to physics
173 ((INonSharedRegionModule)m_physicsScene).AddRegion(testScene);
174 ((INonSharedRegionModule)m_physicsScene).RegionLoaded(testScene);
175
167 // Add scene to services 176 // Add scene to services
168 m_assetService.AddRegion(testScene); 177 m_assetService.AddRegion(testScene);
169 178
@@ -330,6 +339,19 @@ namespace OpenSim.Tests.Common
330 return presenceService; 339 return presenceService;
331 } 340 }
332 341
342 private static PhysicsScene StartPhysicsScene()
343 {
344 IConfigSource config = new IniConfigSource();
345 config.AddConfig("Startup");
346 config.Configs["Startup"].Set("physics", "basicphysics");
347
348 PhysicsScene pScene = new BasicScene();
349 INonSharedRegionModule mod = pScene as INonSharedRegionModule;
350 mod.Initialise(config);
351
352 return pScene;
353 }
354
333 /// <summary> 355 /// <summary>
334 /// Setup modules for a scene using their default settings. 356 /// Setup modules for a scene using their default settings.
335 /// </summary> 357 /// </summary>