From 0af2fafddf36009ffe470da106dc6d0ceb3ced10 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Wed, 19 Aug 2015 11:04:28 +0100 Subject: add missing regionExtent setup and Scene physicsscene configuration ( not exactly as core) --- OpenSim/Region/Application/OpenSimBase.cs | 9 +++++---- OpenSim/Region/ClientStack/RegionApplicationBase.cs | 8 ++++---- OpenSim/Region/Framework/Scenes/Scene.cs | 6 ++++-- 3 files changed, 13 insertions(+), 10 deletions(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Application/OpenSimBase.cs b/OpenSim/Region/Application/OpenSimBase.cs index f663c77..e8cf7cc 100644 --- a/OpenSim/Region/Application/OpenSimBase.cs +++ b/OpenSim/Region/Application/OpenSimBase.cs @@ -767,7 +767,6 @@ namespace OpenSim clientServer = clientNetworkServers; scene.LoadWorldMap(); - scene.PhysicsScene = GetPhysicsScene(scene.RegionInfo.RegionName); scene.PhysicsScene.RequestAssetMethod = scene.PhysicsRequestAsset; scene.PhysicsScene.SetTerrain(scene.Heightmap.GetFloatsSerialised()); scene.PhysicsScene.SetWaterLevel((float) regionInfo.RegionSettings.WaterHeight); @@ -783,10 +782,12 @@ namespace OpenSim protected override Scene CreateScene(RegionInfo regionInfo, ISimulationDataService simDataService, IEstateDataService estateDataService, AgentCircuitManager circuitManager) { + Vector3 regionExtent = new Vector3(regionInfo.RegionSizeX, regionInfo.RegionSizeY, regionInfo.RegionSizeZ); + PhysicsScene physicsScene = GetPhysicsScene(regionInfo.RegionName, regionExtent); SceneCommunicationService sceneGridService = new SceneCommunicationService(); return new Scene( - regionInfo, circuitManager, sceneGridService, + regionInfo, circuitManager, physicsScene, sceneGridService, simDataService, estateDataService, Config, m_version); } @@ -829,10 +830,10 @@ namespace OpenSim # region Setup methods - protected override PhysicsScene GetPhysicsScene(string osSceneIdentifier) + protected override PhysicsScene GetPhysicsScene(string osSceneIdentifier, Vector3 regionExtent) { return GetPhysicsScene( - m_configSettings.PhysicsEngine, m_configSettings.MeshEngineName, Config, osSceneIdentifier); + m_configSettings.PhysicsEngine, m_configSettings.MeshEngineName, Config, osSceneIdentifier, regionExtent); } /// diff --git a/OpenSim/Region/ClientStack/RegionApplicationBase.cs b/OpenSim/Region/ClientStack/RegionApplicationBase.cs index 287c278..982646e 100644 --- a/OpenSim/Region/ClientStack/RegionApplicationBase.cs +++ b/OpenSim/Region/ClientStack/RegionApplicationBase.cs @@ -69,7 +69,7 @@ namespace OpenSim.Region.ClientStack /// The name of the OpenSim scene this physics scene is serving. This will be used in log messages. /// /// - protected abstract PhysicsScene GetPhysicsScene(string osSceneIdentifier); + protected abstract PhysicsScene GetPhysicsScene(string osSceneIdentifier, Vector3 regionExtent); protected abstract ClientStackManager CreateClientStackManager(); protected abstract Scene CreateScene(RegionInfo regionInfo, ISimulationDataService simDataService, IEstateDataService estateDataService, AgentCircuitManager circuitManager); @@ -135,13 +135,13 @@ namespace OpenSim.Region.ClientStack /// /// protected PhysicsScene GetPhysicsScene( - string engine, string meshEngine, IConfigSource config, string osSceneIdentifier) + string engine, string meshEngine, IConfigSource config, string osSceneIdentifier, Vector3 regionExtent) { PhysicsPluginManager physicsPluginManager; physicsPluginManager = new PhysicsPluginManager(); physicsPluginManager.LoadPluginsFromAssemblies("Physics"); - - return physicsPluginManager.GetPhysicsScene(engine, meshEngine, config, osSceneIdentifier); + + return physicsPluginManager.GetPhysicsScene(engine, meshEngine, config, osSceneIdentifier, regionExtent); } } } diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 46c9048..fa5d021 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs @@ -760,7 +760,7 @@ namespace OpenSim.Region.Framework.Scenes #region Constructors - public Scene(RegionInfo regInfo, AgentCircuitManager authen, + public Scene(RegionInfo regInfo, AgentCircuitManager authen, PhysicsScene physicsScene, SceneCommunicationService sceneGridService, ISimulationDataService simDataService, IEstateDataService estateDataService, IConfigSource config, string simulatorVersion) @@ -840,6 +840,7 @@ namespace OpenSim.Region.Framework.Scenes new EventManager.LandObjectRemoved(simDataService.RemoveLandObject); m_sceneGraph = new SceneGraph(this); + m_sceneGraph.PhysicsScene = physicsScene; // If the scene graph has an Unrecoverable error, restart this sim. // Currently the only thing that causes it to happen is two kinds of specific @@ -1075,7 +1076,8 @@ namespace OpenSim.Region.Framework.Scenes { PhysicalPrims = true; CollidablePrims = true; - PhysicsEnabled = true; + // this is done above acording to config + // PhysicsEnabled = true; PeriodicBackup = true; UseBackup = true; -- cgit v1.1