aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics
diff options
context:
space:
mode:
authorJustin Clarke Casey2008-12-15 18:39:54 +0000
committerJustin Clarke Casey2008-12-15 18:39:54 +0000
commit3b0db66b92a9e497d965d2a26c9d6de643612b63 (patch)
tree3452afd22484b8baad138a3ecc5469ea57c8427f /OpenSim/Region/Physics
parent* minor: Stop presence child status suffering an NRE if the agent uuid given ... (diff)
downloadopensim-SC-3b0db66b92a9e497d965d2a26c9d6de643612b63.zip
opensim-SC-3b0db66b92a9e497d965d2a26c9d6de643612b63.tar.gz
opensim-SC-3b0db66b92a9e497d965d2a26c9d6de643612b63.tar.bz2
opensim-SC-3b0db66b92a9e497d965d2a26c9d6de643612b63.tar.xz
* Apply http://opensimulator.org/mantis/view.php?id=2775 with small tweaks
* This pushes an identifier for the OpenSim scene to the physics scene. This allows log messages from the physics scene to identify which OpenSim scene they relate to. * Thanks Gerhard
Diffstat (limited to 'OpenSim/Region/Physics')
-rw-r--r--OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs9
-rw-r--r--OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs10
-rw-r--r--OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs6
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODETestClass.cs2
-rw-r--r--OpenSim/Region/Physics/OdePlugin/OdePlugin.cs13
-rw-r--r--OpenSim/Region/Physics/POSPlugin/POSPlugin.cs4
-rw-r--r--OpenSim/Region/Physics/POSPlugin/POSScene.cs5
-rw-r--r--OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs9
8 files changed, 38 insertions, 20 deletions
diff --git a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs
index 013c9cf..3673302 100644
--- a/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs
+++ b/OpenSim/Region/Physics/BasicPhysicsPlugin/BasicPhysicsPlugin.cs
@@ -47,9 +47,9 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
47 return true; 47 return true;
48 } 48 }
49 49
50 public PhysicsScene GetScene() 50 public PhysicsScene GetScene(string sceneIdentifier)
51 { 51 {
52 return new BasicScene(); 52 return new BasicScene(sceneIdentifier);
53 } 53 }
54 54
55 public string GetName() 55 public string GetName()
@@ -67,8 +67,11 @@ namespace OpenSim.Region.Physics.BasicPhysicsPlugin
67 private List<BasicActor> _actors = new List<BasicActor>(); 67 private List<BasicActor> _actors = new List<BasicActor>();
68 private float[] _heightMap; 68 private float[] _heightMap;
69 69
70 public BasicScene() 70 string sceneIdentifier;
71
72 public BasicScene(string _sceneIdentifier)
71 { 73 {
74 sceneIdentifier = _sceneIdentifier;
72 } 75 }
73 76
74 public override void Initialise(IMesher meshmerizer, IConfigSource config) 77 public override void Initialise(IMesher meshmerizer, IConfigSource config)
diff --git a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs
index 4f1afdd..8f5ffd8 100644
--- a/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs
+++ b/OpenSim/Region/Physics/BulletXPlugin/BulletXPlugin.cs
@@ -212,11 +212,11 @@ namespace OpenSim.Region.Physics.BulletXPlugin
212 return true; 212 return true;
213 } 213 }
214 214
215 public PhysicsScene GetScene() 215 public PhysicsScene GetScene(string sceneIdentifier)
216 { 216 {
217 if (_mScene == null) 217 if (_mScene == null)
218 { 218 {
219 _mScene = new BulletXScene(); 219 _mScene = new BulletXScene(sceneIdentifier);
220 } 220 }
221 return (_mScene); 221 return (_mScene);
222 } 222 }
@@ -493,6 +493,12 @@ namespace OpenSim.Region.Physics.BulletXPlugin
493 public IMesher mesher; 493 public IMesher mesher;
494 // private IConfigSource m_config; 494 // private IConfigSource m_config;
495 495
496 String identifier;
497
498 public BulletXScene(String sceneIdentifier)
499 {
500 identifier = sceneIdentifier;
501 }
496 502
497 public static float Gravity 503 public static float Gravity
498 { 504 {
diff --git a/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs b/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs
index 428a586..4ab8d44 100644
--- a/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs
+++ b/OpenSim/Region/Physics/Manager/PhysicsPluginManager.cs
@@ -65,7 +65,7 @@ namespace OpenSim.Region.Physics.Manager
65 /// <param name="meshEngineName"></param> 65 /// <param name="meshEngineName"></param>
66 /// <param name="config"></param> 66 /// <param name="config"></param>
67 /// <returns></returns> 67 /// <returns></returns>
68 public PhysicsScene GetPhysicsScene(string physEngineName, string meshEngineName, IConfigSource config) 68 public PhysicsScene GetPhysicsScene(string physEngineName, string meshEngineName, IConfigSource config, string regionName)
69 { 69 {
70 if (String.IsNullOrEmpty(physEngineName)) 70 if (String.IsNullOrEmpty(physEngineName))
71 { 71 {
@@ -92,7 +92,7 @@ namespace OpenSim.Region.Physics.Manager
92 if (_PhysPlugins.ContainsKey(physEngineName)) 92 if (_PhysPlugins.ContainsKey(physEngineName))
93 { 93 {
94 m_log.Info("[PHYSICS]: creating " + physEngineName); 94 m_log.Info("[PHYSICS]: creating " + physEngineName);
95 PhysicsScene result = _PhysPlugins[physEngineName].GetScene(); 95 PhysicsScene result = _PhysPlugins[physEngineName].GetScene(regionName);
96 result.Initialise(meshEngine, config); 96 result.Initialise(meshEngine, config);
97 return result; 97 return result;
98 } 98 }
@@ -226,7 +226,7 @@ namespace OpenSim.Region.Physics.Manager
226 public interface IPhysicsPlugin 226 public interface IPhysicsPlugin
227 { 227 {
228 bool Init(); 228 bool Init();
229 PhysicsScene GetScene(); 229 PhysicsScene GetScene(String sceneIdentifier);
230 string GetName(); 230 string GetName();
231 void Dispose(); 231 void Dispose();
232 } 232 }
diff --git a/OpenSim/Region/Physics/OdePlugin/ODETestClass.cs b/OpenSim/Region/Physics/OdePlugin/ODETestClass.cs
index 606134a..c913639 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODETestClass.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODETestClass.cs
@@ -49,7 +49,7 @@ namespace OpenSim.Region.Physics.OdePlugin
49 // Loading Zero Mesher 49 // Loading Zero Mesher
50 imp = new ZeroMesherPlugin(); 50 imp = new ZeroMesherPlugin();
51 // Getting Physics Scene 51 // Getting Physics Scene
52 ps = cbt.GetScene(); 52 ps = cbt.GetScene("test");
53 // Initializing Physics Scene. 53 // Initializing Physics Scene.
54 ps.Initialise(imp.GetMesher(),null); 54 ps.Initialise(imp.GetMesher(),null);
55 float[] _heightmap = new float[256 * 256]; 55 float[] _heightmap = new float[256 * 256];
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
index b066d0c..d1a3ce7 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
@@ -66,7 +66,7 @@ namespace OpenSim.Region.Physics.OdePlugin
66 return true; 66 return true;
67 } 67 }
68 68
69 public PhysicsScene GetScene() 69 public PhysicsScene GetScene(String sceneIdentifier)
70 { 70 {
71 if (_mScene == null) 71 if (_mScene == null)
72 { 72 {
@@ -74,7 +74,7 @@ namespace OpenSim.Region.Physics.OdePlugin
74 // http://opensimulator.org/mantis/view.php?id=2750). 74 // http://opensimulator.org/mantis/view.php?id=2750).
75 d.InitODE(); 75 d.InitODE();
76 76
77 _mScene = new OdeScene(ode); 77 _mScene = new OdeScene(ode, sceneIdentifier);
78 } 78 }
79 return (_mScene); 79 return (_mScene);
80 } 80 }
@@ -123,7 +123,7 @@ namespace OpenSim.Region.Physics.OdePlugin
123 123
124 public class OdeScene : PhysicsScene 124 public class OdeScene : PhysicsScene
125 { 125 {
126 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 126 private ILog m_log;
127 // private Dictionary<string, sCollisionData> m_storedCollisions = new Dictionary<string, sCollisionData>(); 127 // private Dictionary<string, sCollisionData> m_storedCollisions = new Dictionary<string, sCollisionData>();
128 128
129 CollisionLocker ode; 129 CollisionLocker ode;
@@ -270,8 +270,11 @@ namespace OpenSim.Region.Physics.OdePlugin
270 /// Sets many properties that ODE requires to be stable 270 /// Sets many properties that ODE requires to be stable
271 /// These settings need to be tweaked 'exactly' right or weird stuff happens. 271 /// These settings need to be tweaked 'exactly' right or weird stuff happens.
272 /// </summary> 272 /// </summary>
273 public OdeScene(CollisionLocker dode) 273 public OdeScene(CollisionLocker dode, string sceneIdentifier)
274 { 274 {
275 m_log
276 = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType.ToString() + "." + sceneIdentifier);
277
275 OdeLock = new Object(); 278 OdeLock = new Object();
276 ode = dode; 279 ode = dode;
277 nearCallback = near; 280 nearCallback = near;
diff --git a/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs b/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs
index c8cbcf5..04e3e75 100644
--- a/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs
+++ b/OpenSim/Region/Physics/POSPlugin/POSPlugin.cs
@@ -47,9 +47,9 @@ namespace OpenSim.Region.Physics.POSPlugin
47 return true; 47 return true;
48 } 48 }
49 49
50 public PhysicsScene GetScene() 50 public PhysicsScene GetScene(string sceneIdentifier)
51 { 51 {
52 return new POSScene(); 52 return new POSScene(sceneIdentifier);
53 } 53 }
54 54
55 public string GetName() 55 public string GetName()
diff --git a/OpenSim/Region/Physics/POSPlugin/POSScene.cs b/OpenSim/Region/Physics/POSPlugin/POSScene.cs
index 9a4e92f..43af72d 100644
--- a/OpenSim/Region/Physics/POSPlugin/POSScene.cs
+++ b/OpenSim/Region/Physics/POSPlugin/POSScene.cs
@@ -41,8 +41,11 @@ namespace OpenSim.Region.Physics.POSPlugin
41 private float[] _heightMap; 41 private float[] _heightMap;
42 private const float gravity = -9.8f; 42 private const float gravity = -9.8f;
43 43
44 public POSScene() 44 string sceneIdentifier;
45
46 public POSScene(String _sceneIdentifier)
45 { 47 {
48 sceneIdentifier = _sceneIdentifier;
46 } 49 }
47 50
48 public override void Initialise(IMesher meshmerizer, IConfigSource config) 51 public override void Initialise(IMesher meshmerizer, IConfigSource config)
diff --git a/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs b/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs
index 6502827..a7ee26d 100644
--- a/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs
+++ b/OpenSim/Region/Physics/PhysXPlugin/PhysXPlugin.cs
@@ -51,11 +51,11 @@ namespace OpenSim.Region.Physics.PhysXPlugin
51 return true; 51 return true;
52 } 52 }
53 53
54 public PhysicsScene GetScene() 54 public PhysicsScene GetScene(string sceneIdentifier)
55 { 55 {
56 if (_mScene == null) 56 if (_mScene == null)
57 { 57 {
58 _mScene = new PhysXScene(); 58 _mScene = new PhysXScene(sceneIdentifier);
59 } 59 }
60 return (_mScene); 60 return (_mScene);
61 } 61 }
@@ -78,8 +78,11 @@ namespace OpenSim.Region.Physics.PhysXPlugin
78 private NxPhysicsSDK mySdk; 78 private NxPhysicsSDK mySdk;
79 private NxScene scene; 79 private NxScene scene;
80 80
81 public PhysXScene() 81 string sceneIdentifier;
82 public PhysXScene(string _sceneIdentifier)
82 { 83 {
84 sceneIdentifier = _sceneIdentifier;
85
83 mySdk = NxPhysicsSDK.CreateSDK(); 86 mySdk = NxPhysicsSDK.CreateSDK();
84 Console.WriteLine("Sdk created - now creating scene"); 87 Console.WriteLine("Sdk created - now creating scene");
85 scene = mySdk.CreateScene(); 88 scene = mySdk.CreateScene();