diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Tests/Common/Helpers/SceneHelpers.cs | 28 |
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; | |||
32 | using OpenMetaverse; | 32 | using OpenMetaverse; |
33 | using OpenSim.Data.Null; | 33 | using OpenSim.Data.Null; |
34 | using OpenSim.Framework; | 34 | using OpenSim.Framework; |
35 | using OpenSim.Framework.Communications; | 35 | |
36 | using OpenSim.Framework.Console; | 36 | using OpenSim.Framework.Console; |
37 | using OpenSim.Framework.Servers; | 37 | using OpenSim.Framework.Servers; |
38 | using OpenSim.Framework.Servers.HttpServer; | 38 | using OpenSim.Framework.Servers.HttpServer; |
39 | using OpenSim.Region.Physics.Manager; | 39 | using OpenSim.Region.PhysicsModules.SharedBase; |
40 | using OpenSim.Region.Framework; | 40 | using OpenSim.Region.Framework; |
41 | using OpenSim.Region.Framework.Interfaces; | 41 | using OpenSim.Region.Framework.Interfaces; |
42 | using OpenSim.Region.Framework.Scenes; | 42 | using OpenSim.Region.Framework.Scenes; |
@@ -48,6 +48,7 @@ using OpenSim.Region.CoreModules.ServiceConnectorsOut.Inventory; | |||
48 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid; | 48 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.Grid; |
49 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts; | 49 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.UserAccounts; |
50 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence; | 50 | using OpenSim.Region.CoreModules.ServiceConnectorsOut.Presence; |
51 | using OpenSim.Region.PhysicsModule.BasicPhysics; | ||
51 | using OpenSim.Services.Interfaces; | 52 | using OpenSim.Services.Interfaces; |
52 | using GridRegion = OpenSim.Services.Interfaces.GridRegion; | 53 | using 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> |