add missing regionExtent setup and Scene physicsscene configuration ( not

exactly as core)
avinationmerge
UbitUmarov 2015-08-19 11:04:28 +01:00
parent 0b105da626
commit 0af2fafddf
5 changed files with 24 additions and 18 deletions

View File

@ -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);
}
/// <summary>

View File

@ -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.
/// </param>
/// <returns></returns>
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
/// </param>
/// <returns></returns>
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);
}
}
}

View File

@ -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;

View File

@ -138,8 +138,15 @@ namespace OpenSim.Tests.Common
SceneCommunicationService scs = new SceneCommunicationService();
PhysicsPluginManager physicsPluginManager = new PhysicsPluginManager();
physicsPluginManager.LoadPluginsFromAssembly("Physics/OpenSim.Region.Physics.BasicPhysicsPlugin.dll");
Vector3 regionExtent = new Vector3(regInfo.RegionSizeX, regInfo.RegionSizeY, regInfo.RegionSizeZ);
PhysicsScene physicsScene
= physicsPluginManager.GetPhysicsScene(
"basicphysics", "ZeroMesher", new IniConfigSource(), "test", regionExtent);
TestScene testScene = new TestScene(
regInfo, m_acm, scs, m_simDataService, m_estateDataService, configSource, null);
regInfo, m_acm, physicsScene, scs, m_simDataService, m_estateDataService, configSource, null);
INonSharedRegionModule godsModule = new GodsModule();
godsModule.Initialise(new IniConfigSource());
@ -184,11 +191,6 @@ namespace OpenSim.Tests.Common
testScene.LandChannel = new TestLandChannel(testScene);
testScene.LoadWorldMap();
PhysicsPluginManager physicsPluginManager = new PhysicsPluginManager();
physicsPluginManager.LoadPluginsFromAssembly("Physics/OpenSim.Region.Physics.BasicPhysicsPlugin.dll");
testScene.PhysicsScene
= physicsPluginManager.GetPhysicsScene("basicphysics", "ZeroMesher", new IniConfigSource(), "test");
testScene.RegionInfo.EstateSettings = new EstateSettings();
testScene.LoginsEnabled = true;
testScene.RegisterRegionWithGrid();

View File

@ -33,16 +33,17 @@ using OpenSim.Framework.Servers;
using OpenSim.Region.Framework;
using OpenSim.Region.Framework.Interfaces;
using OpenSim.Region.Framework.Scenes;
using OpenSim.Region.Physics.Manager;
namespace OpenSim.Tests.Common.Mock
{
public class TestScene : Scene
{
public TestScene(
RegionInfo regInfo, AgentCircuitManager authen,
RegionInfo regInfo, AgentCircuitManager authen, PhysicsScene physicsScene,
SceneCommunicationService sceneGridService, ISimulationDataService simDataService, IEstateDataService estateDataService,
IConfigSource config, string simulatorVersion)
: base(regInfo, authen, sceneGridService, simDataService, estateDataService,
: base(regInfo, authen, physicsScene, sceneGridService, simDataService, estateDataService,
config, simulatorVersion)
{
}