aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/PhysicsModules
diff options
context:
space:
mode:
authorDiva Canto2015-08-31 14:09:15 -0700
committerDiva Canto2015-08-31 14:09:15 -0700
commit11194209df8a29f5103e6e34104eae7834f3280a (patch)
tree605cd55258ef11167a8bfa4c894e1e026e172919 /OpenSim/Region/PhysicsModules
parentAll physics plugins are now region modules. Compiles but doesn't run. (diff)
downloadopensim-SC_OLD-11194209df8a29f5103e6e34104eae7834f3280a.zip
opensim-SC_OLD-11194209df8a29f5103e6e34104eae7834f3280a.tar.gz
opensim-SC_OLD-11194209df8a29f5103e6e34104eae7834f3280a.tar.bz2
opensim-SC_OLD-11194209df8a29f5103e6e34104eae7834f3280a.tar.xz
First commit where physics work as region module.
Moved all physics dlls out of Physics and into bin directly, so they can be found by the module loader. Removed call to PhysicsPluginManager.
Diffstat (limited to 'OpenSim/Region/PhysicsModules')
-rw-r--r--OpenSim/Region/PhysicsModules/BasicPhysics/BasicPhysicsScene.cs1
-rw-r--r--OpenSim/Region/PhysicsModules/BulletS/BSScene.cs5
-rwxr-xr-xOpenSim/Region/PhysicsModules/BulletS/Tests/BulletSimTestsUtil.cs27
-rw-r--r--OpenSim/Region/PhysicsModules/Ode/OdeScene.cs2
-rw-r--r--OpenSim/Region/PhysicsModules/POS/POSScene.cs2
-rw-r--r--OpenSim/Region/PhysicsModules/SharedBase/PhysicsScene.cs8
6 files changed, 36 insertions, 9 deletions
diff --git a/OpenSim/Region/PhysicsModules/BasicPhysics/BasicPhysicsScene.cs b/OpenSim/Region/PhysicsModules/BasicPhysics/BasicPhysicsScene.cs
index 5ec0f85..f7760c5 100644
--- a/OpenSim/Region/PhysicsModules/BasicPhysics/BasicPhysicsScene.cs
+++ b/OpenSim/Region/PhysicsModules/BasicPhysics/BasicPhysicsScene.cs
@@ -93,6 +93,7 @@ namespace OpenSim.Region.PhysicsModule.BasicPhysics
93 93
94 scene.RegisterModuleInterface<PhysicsScene>(this); 94 scene.RegisterModuleInterface<PhysicsScene>(this);
95 m_regionExtent = new Vector3(scene.RegionInfo.RegionSizeX, scene.RegionInfo.RegionSizeY, scene.RegionInfo.RegionSizeZ); 95 m_regionExtent = new Vector3(scene.RegionInfo.RegionSizeX, scene.RegionInfo.RegionSizeY, scene.RegionInfo.RegionSizeZ);
96 base.Initialise(scene.PhysicsRequestAsset, scene.Heightmap.GetFloatsSerialised(), (float)scene.RegionInfo.RegionSettings.WaterHeight);
96 97
97 } 98 }
98 99
diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSScene.cs b/OpenSim/Region/PhysicsModules/BulletS/BSScene.cs
index 26af343..b412561 100644
--- a/OpenSim/Region/PhysicsModules/BulletS/BSScene.cs
+++ b/OpenSim/Region/PhysicsModules/BulletS/BSScene.cs
@@ -248,7 +248,10 @@ namespace OpenSim.Region.PhysicsModule.BulletS
248 248
249 scene.RegisterModuleInterface<PhysicsScene>(this); 249 scene.RegisterModuleInterface<PhysicsScene>(this);
250 Vector3 extent = new Vector3(scene.RegionInfo.RegionSizeX, scene.RegionInfo.RegionSizeY, scene.RegionInfo.RegionSizeZ); 250 Vector3 extent = new Vector3(scene.RegionInfo.RegionSizeX, scene.RegionInfo.RegionSizeY, scene.RegionInfo.RegionSizeZ);
251 Initialise(m_Config, extent); 251 Initialise(m_Config, extent);
252
253 base.Initialise(scene.PhysicsRequestAsset, scene.Heightmap.GetFloatsSerialised(), (float)scene.RegionInfo.RegionSettings.WaterHeight);
254
252 } 255 }
253 256
254 public void RemoveRegion(Scene scene) 257 public void RemoveRegion(Scene scene)
diff --git a/OpenSim/Region/PhysicsModules/BulletS/Tests/BulletSimTestsUtil.cs b/OpenSim/Region/PhysicsModules/BulletS/Tests/BulletSimTestsUtil.cs
index 34c0571..d86c841 100755
--- a/OpenSim/Region/PhysicsModules/BulletS/Tests/BulletSimTestsUtil.cs
+++ b/OpenSim/Region/PhysicsModules/BulletS/Tests/BulletSimTestsUtil.cs
@@ -35,6 +35,7 @@ using Nini.Config;
35using OpenSim.Framework; 35using OpenSim.Framework;
36using OpenSim.Region.PhysicsModules.SharedBase; 36using OpenSim.Region.PhysicsModules.SharedBase;
37using OpenSim.Region.PhysicsModules.Meshing; 37using OpenSim.Region.PhysicsModules.Meshing;
38using OpenSim.Region.Framework.Interfaces;
38 39
39using OpenMetaverse; 40using OpenMetaverse;
40 41
@@ -78,22 +79,32 @@ public static class BulletSimTestsUtil
78 bulletSimConfig.Set("VehicleLoggingEnabled","True"); 79 bulletSimConfig.Set("VehicleLoggingEnabled","True");
79 } 80 }
80 81
81 PhysicsPluginManager physicsPluginManager;
82 physicsPluginManager = new PhysicsPluginManager();
83 physicsPluginManager.LoadPluginsFromAssemblies("Physics");
84
85 Vector3 regionExtent = new Vector3(Constants.RegionSize, Constants.RegionSize, Constants.RegionHeight); 82 Vector3 regionExtent = new Vector3(Constants.RegionSize, Constants.RegionSize, Constants.RegionHeight);
86 83
87 PhysicsScene pScene = physicsPluginManager.GetPhysicsScene( 84 //PhysicsScene pScene = physicsPluginManager.GetPhysicsScene(
88 "BulletSim", "Meshmerizer", openSimINI, "BSTestRegion", regionExtent); 85 // "BulletSim", "Meshmerizer", openSimINI, "BSTestRegion", regionExtent);
86 RegionInfo info = new RegionInfo();
87 info.RegionName = "BSTestRegion";
88 info.RegionSizeX = info.RegionSizeY = info.RegionSizeZ = Constants.RegionSize;
89 OpenSim.Region.Framework.Scenes.Scene scene = new OpenSim.Region.Framework.Scenes.Scene(info);
90
91 IMesher mesher = new OpenSim.Region.PhysicsModules.Meshing.Meshmerizer();
92 INonSharedRegionModule mod = mesher as INonSharedRegionModule;
93 mod.Initialise(openSimINI);
94 mod.AddRegion(scene);
95 mod.RegionLoaded(scene);
89 96
90 BSScene bsScene = pScene as BSScene; 97 BSScene pScene = new BSScene();
98 mod = (pScene as INonSharedRegionModule);
99 mod.Initialise(openSimINI);
100 mod.AddRegion(scene);
101 mod.RegionLoaded(scene);
91 102
92 // Since the asset requestor is not initialized, any mesh or sculptie will be a cube. 103 // Since the asset requestor is not initialized, any mesh or sculptie will be a cube.
93 // In the future, add a fake asset fetcher to get meshes and sculpts. 104 // In the future, add a fake asset fetcher to get meshes and sculpts.
94 // bsScene.RequestAssetMethod = ???; 105 // bsScene.RequestAssetMethod = ???;
95 106
96 return bsScene; 107 return pScene;
97 } 108 }
98 109
99} 110}
diff --git a/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs b/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs
index 3616200..f090953 100644
--- a/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs
+++ b/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs
@@ -585,6 +585,8 @@ namespace OpenSim.Region.PhysicsModule.ODE
585 Vector3 extent = new Vector3(scene.RegionInfo.RegionSizeX, scene.RegionInfo.RegionSizeY, scene.RegionInfo.RegionSizeZ); 585 Vector3 extent = new Vector3(scene.RegionInfo.RegionSizeX, scene.RegionInfo.RegionSizeY, scene.RegionInfo.RegionSizeZ);
586 Initialise(); 586 Initialise();
587 InitialiseFromConfig(m_config); 587 InitialiseFromConfig(m_config);
588 base.Initialise(scene.PhysicsRequestAsset, scene.Heightmap.GetFloatsSerialised(), (float)scene.RegionInfo.RegionSettings.WaterHeight);
589
588 } 590 }
589 591
590 public void RemoveRegion(Scene scene) 592 public void RemoveRegion(Scene scene)
diff --git a/OpenSim/Region/PhysicsModules/POS/POSScene.cs b/OpenSim/Region/PhysicsModules/POS/POSScene.cs
index 915fa8c..beaa177 100644
--- a/OpenSim/Region/PhysicsModules/POS/POSScene.cs
+++ b/OpenSim/Region/PhysicsModules/POS/POSScene.cs
@@ -85,6 +85,8 @@ namespace OpenSim.Region.PhysicsModule.POS
85 PhysicsSceneName = EngineType + "/" + scene.RegionInfo.RegionName; 85 PhysicsSceneName = EngineType + "/" + scene.RegionInfo.RegionName;
86 86
87 scene.RegisterModuleInterface<PhysicsScene>(this); 87 scene.RegisterModuleInterface<PhysicsScene>(this);
88 base.Initialise(scene.PhysicsRequestAsset, scene.Heightmap.GetFloatsSerialised(), (float)scene.RegionInfo.RegionSettings.WaterHeight);
89
88 } 90 }
89 91
90 public void RemoveRegion(Scene scene) 92 public void RemoveRegion(Scene scene)
diff --git a/OpenSim/Region/PhysicsModules/SharedBase/PhysicsScene.cs b/OpenSim/Region/PhysicsModules/SharedBase/PhysicsScene.cs
index 247f355..32691fc 100644
--- a/OpenSim/Region/PhysicsModules/SharedBase/PhysicsScene.cs
+++ b/OpenSim/Region/PhysicsModules/SharedBase/PhysicsScene.cs
@@ -117,6 +117,14 @@ namespace OpenSim.Region.PhysicsModules.SharedBase
117 117
118 public RequestAssetDelegate RequestAssetMethod { get; set; } 118 public RequestAssetDelegate RequestAssetMethod { get; set; }
119 119
120 protected void Initialise(RequestAssetDelegate m, float[] terrain, float waterHeight)
121 {
122 RequestAssetMethod = m;
123 SetTerrain(terrain);
124 SetWaterLevel(waterHeight);
125
126 }
127
120 public virtual void TriggerPhysicsBasedRestart() 128 public virtual void TriggerPhysicsBasedRestart()
121 { 129 {
122 physicsCrash handler = OnPhysicsCrash; 130 physicsCrash handler = OnPhysicsCrash;