aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/PhysicsModules/UbitOde
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/PhysicsModules/UbitOde')
-rw-r--r--OpenSim/Region/PhysicsModules/UbitOde/ODECharacter.cs4
-rw-r--r--OpenSim/Region/PhysicsModules/UbitOde/ODEDynamics.cs2
-rw-r--r--OpenSim/Region/PhysicsModules/UbitOde/ODEMeshWorker.cs4
-rw-r--r--OpenSim/Region/PhysicsModules/UbitOde/ODEPrim.cs4
-rw-r--r--OpenSim/Region/PhysicsModules/UbitOde/ODERayCastRequestManager.cs4
-rw-r--r--OpenSim/Region/PhysicsModules/UbitOde/ODESitAvatar.cs4
-rw-r--r--OpenSim/Region/PhysicsModules/UbitOde/OdeScene.cs45
7 files changed, 40 insertions, 27 deletions
diff --git a/OpenSim/Region/PhysicsModules/UbitOde/ODECharacter.cs b/OpenSim/Region/PhysicsModules/UbitOde/ODECharacter.cs
index e461dcd..0edc46f 100644
--- a/OpenSim/Region/PhysicsModules/UbitOde/ODECharacter.cs
+++ b/OpenSim/Region/PhysicsModules/UbitOde/ODECharacter.cs
@@ -138,7 +138,7 @@ namespace OpenSim.Region.PhysicsModules.UbitOde
138 ); 138 );
139 // we do land collisions not ode | CollisionCategories.Land); 139 // we do land collisions not ode | CollisionCategories.Land);
140 public IntPtr Body = IntPtr.Zero; 140 public IntPtr Body = IntPtr.Zero;
141 private OdeScene _parent_scene; 141 private ODEScene _parent_scene;
142 private IntPtr capsule = IntPtr.Zero; 142 private IntPtr capsule = IntPtr.Zero;
143 public IntPtr collider = IntPtr.Zero; 143 public IntPtr collider = IntPtr.Zero;
144 144
@@ -157,7 +157,7 @@ namespace OpenSim.Region.PhysicsModules.UbitOde
157 157
158 float mu; 158 float mu;
159 159
160 public OdeCharacter(uint localID, String avName, OdeScene parent_scene, Vector3 pos, Vector3 pSize, float pfeetOffset, float density, float walk_divisor, float rundivisor) 160 public OdeCharacter(uint localID, String avName, ODEScene parent_scene, Vector3 pos, Vector3 pSize, float pfeetOffset, float density, float walk_divisor, float rundivisor)
161 { 161 {
162 m_uuid = UUID.Random(); 162 m_uuid = UUID.Random();
163 m_localID = localID; 163 m_localID = localID;
diff --git a/OpenSim/Region/PhysicsModules/UbitOde/ODEDynamics.cs b/OpenSim/Region/PhysicsModules/UbitOde/ODEDynamics.cs
index 9f1ab4c..89adab8 100644
--- a/OpenSim/Region/PhysicsModules/UbitOde/ODEDynamics.cs
+++ b/OpenSim/Region/PhysicsModules/UbitOde/ODEDynamics.cs
@@ -60,7 +60,7 @@ namespace OpenSim.Region.PhysicsModules.UbitOde
60 } 60 }
61 61
62 private OdePrim rootPrim; 62 private OdePrim rootPrim;
63 private OdeScene _pParentScene; 63 private ODEScene _pParentScene;
64 64
65 // Vehicle properties 65 // Vehicle properties
66 // WARNING this are working copies for internel use 66 // WARNING this are working copies for internel use
diff --git a/OpenSim/Region/PhysicsModules/UbitOde/ODEMeshWorker.cs b/OpenSim/Region/PhysicsModules/UbitOde/ODEMeshWorker.cs
index d4ba8a3..6fb10b1 100644
--- a/OpenSim/Region/PhysicsModules/UbitOde/ODEMeshWorker.cs
+++ b/OpenSim/Region/PhysicsModules/UbitOde/ODEMeshWorker.cs
@@ -71,7 +71,7 @@ namespace OpenSim.Region.PhysicsModules.UbitOde
71 { 71 {
72 72
73 private ILog m_log; 73 private ILog m_log;
74 private OdeScene m_scene; 74 private ODEScene m_scene;
75 private IMesher m_mesher; 75 private IMesher m_mesher;
76 76
77 public bool meshSculptedPrim = true; 77 public bool meshSculptedPrim = true;
@@ -85,7 +85,7 @@ namespace OpenSim.Region.PhysicsModules.UbitOde
85 85
86 private Thread m_thread; 86 private Thread m_thread;
87 87
88 public ODEMeshWorker(OdeScene pScene, ILog pLog, IMesher pMesher, IConfig pConfig) 88 public ODEMeshWorker(ODEScene pScene, ILog pLog, IMesher pMesher, IConfig pConfig)
89 { 89 {
90 m_scene = pScene; 90 m_scene = pScene;
91 m_log = pLog; 91 m_log = pLog;
diff --git a/OpenSim/Region/PhysicsModules/UbitOde/ODEPrim.cs b/OpenSim/Region/PhysicsModules/UbitOde/ODEPrim.cs
index 2e75bc9..344cfcc 100644
--- a/OpenSim/Region/PhysicsModules/UbitOde/ODEPrim.cs
+++ b/OpenSim/Region/PhysicsModules/UbitOde/ODEPrim.cs
@@ -148,7 +148,7 @@ namespace OpenSim.Region.PhysicsModules.UbitOde
148 private UUID? m_assetID; 148 private UUID? m_assetID;
149 private MeshState m_meshState; 149 private MeshState m_meshState;
150 150
151 public OdeScene _parent_scene; 151 public ODEScene _parent_scene;
152 152
153 /// <summary> 153 /// <summary>
154 /// The physics space which contains prim geometry 154 /// The physics space which contains prim geometry
@@ -1069,7 +1069,7 @@ namespace OpenSim.Region.PhysicsModules.UbitOde
1069 return false; 1069 return false;
1070 } 1070 }
1071 1071
1072 public OdePrim(String primName, OdeScene parent_scene, Vector3 pos, Vector3 size, 1072 public OdePrim(String primName, ODEScene parent_scene, Vector3 pos, Vector3 size,
1073 Quaternion rotation, PrimitiveBaseShape pbs, bool pisPhysical,bool pisPhantom,byte _shapeType,uint plocalID) 1073 Quaternion rotation, PrimitiveBaseShape pbs, bool pisPhysical,bool pisPhantom,byte _shapeType,uint plocalID)
1074 { 1074 {
1075 Name = primName; 1075 Name = primName;
diff --git a/OpenSim/Region/PhysicsModules/UbitOde/ODERayCastRequestManager.cs b/OpenSim/Region/PhysicsModules/UbitOde/ODERayCastRequestManager.cs
index d8add0c..eac4515 100644
--- a/OpenSim/Region/PhysicsModules/UbitOde/ODERayCastRequestManager.cs
+++ b/OpenSim/Region/PhysicsModules/UbitOde/ODERayCastRequestManager.cs
@@ -53,7 +53,7 @@ namespace OpenSim.Region.PhysicsModules.UbitOde
53 /// <summary> 53 /// <summary>
54 /// Scene that created this object. 54 /// Scene that created this object.
55 /// </summary> 55 /// </summary>
56 private OdeScene m_scene; 56 private ODEScene m_scene;
57 57
58 IntPtr ray; // the ray. we only need one for our lifetime 58 IntPtr ray; // the ray. we only need one for our lifetime
59 IntPtr Sphere; 59 IntPtr Sphere;
@@ -73,7 +73,7 @@ namespace OpenSim.Region.PhysicsModules.UbitOde
73 private RayFilterFlags CurrentRayFilter; 73 private RayFilterFlags CurrentRayFilter;
74 private int CurrentMaxCount; 74 private int CurrentMaxCount;
75 75
76 public ODERayCastRequestManager(OdeScene pScene) 76 public ODERayCastRequestManager(ODEScene pScene)
77 { 77 {
78 m_scene = pScene; 78 m_scene = pScene;
79 nearCallback = near; 79 nearCallback = near;
diff --git a/OpenSim/Region/PhysicsModules/UbitOde/ODESitAvatar.cs b/OpenSim/Region/PhysicsModules/UbitOde/ODESitAvatar.cs
index 79d23b1..b1c758e 100644
--- a/OpenSim/Region/PhysicsModules/UbitOde/ODESitAvatar.cs
+++ b/OpenSim/Region/PhysicsModules/UbitOde/ODESitAvatar.cs
@@ -42,10 +42,10 @@ namespace OpenSim.Region.PhysicsModules.UbitOde
42 /// </summary> 42 /// </summary>
43 public class ODESitAvatar 43 public class ODESitAvatar
44 { 44 {
45 private OdeScene m_scene; 45 private ODEScene m_scene;
46 private ODERayCastRequestManager m_raymanager; 46 private ODERayCastRequestManager m_raymanager;
47 47
48 public ODESitAvatar(OdeScene pScene, ODERayCastRequestManager raymanager) 48 public ODESitAvatar(ODEScene pScene, ODERayCastRequestManager raymanager)
49 { 49 {
50 m_scene = pScene; 50 m_scene = pScene;
51 m_raymanager = raymanager; 51 m_raymanager = raymanager;
diff --git a/OpenSim/Region/PhysicsModules/UbitOde/OdeScene.cs b/OpenSim/Region/PhysicsModules/UbitOde/OdeScene.cs
index 7735db6..fe8f5d8 100644
--- a/OpenSim/Region/PhysicsModules/UbitOde/OdeScene.cs
+++ b/OpenSim/Region/PhysicsModules/UbitOde/OdeScene.cs
@@ -37,8 +37,10 @@ using System.IO;
37using System.Diagnostics; 37using System.Diagnostics;
38using log4net; 38using log4net;
39using Nini.Config; 39using Nini.Config;
40using Mono.Addins;
40using OdeAPI; 41using OdeAPI;
41using OpenSim.Framework; 42using OpenSim.Framework;
43using OpenSim.Region.Framework.Scenes;
42using OpenSim.Region.Framework.Interfaces; 44using OpenSim.Region.Framework.Interfaces;
43using OpenSim.Region.PhysicsModules.SharedBase; 45using OpenSim.Region.PhysicsModules.SharedBase;
44using OpenMetaverse; 46using OpenMetaverse;
@@ -163,11 +165,13 @@ namespace OpenSim.Region.PhysicsModules.UbitOde
163 public Object arg; 165 public Object arg;
164 } 166 }
165 167
166
167 168
168 public class OdeScene : PhysicsScene, INonSharedRegionModule 169 [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "UBITODEPhysicsScene")]
170 public class ODEScene : PhysicsScene, INonSharedRegionModule
169 { 171 {
170 private readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType.ToString() + "." + sceneIdentifier); 172 private readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType.ToString());
173 private bool m_Enabled = false;
174
171 // private Dictionary<string, sCollisionData> m_storedCollisions = new Dictionary<string, sCollisionData>(); 175 // private Dictionary<string, sCollisionData> m_storedCollisions = new Dictionary<string, sCollisionData>();
172 176
173 public bool OdeUbitLib = false; 177 public bool OdeUbitLib = false;
@@ -300,7 +304,7 @@ namespace OpenSim.Region.PhysicsModules.UbitOde
300 304
301 public IMesher mesher; 305 public IMesher mesher;
302 306
303 private IConfigSource m_config; 307 public IConfigSource m_config;
304 308
305 public bool physics_logging = false; 309 public bool physics_logging = false;
306 public int physics_logging_interval = 0; 310 public int physics_logging_interval = 0;
@@ -346,7 +350,20 @@ namespace OpenSim.Region.PhysicsModules.UbitOde
346 if (physics == Name) 350 if (physics == Name)
347 { 351 {
348 m_Enabled = true; 352 m_Enabled = true;
349 m_Config = source; 353 m_config = source;
354
355 // We do this so that OpenSimulator on Windows loads the correct native ODE library depending on whether
356 // it's running as a 32-bit process or a 64-bit one. By invoking LoadLibary here, later DLLImports
357 // will find it already loaded later on.
358 //
359 // This isn't necessary for other platforms (e.g. Mac OSX and Linux) since the DLL used can be
360 // controlled in Ode.NET.dll.config
361 if (Util.IsWindows())
362 Util.LoadArchSpecificWindowsDll("ode.dll");
363
364 // Initializing ODE only when a scene is created allows alternative ODE plugins to co-habit (according to
365 // http://opensimulator.org/mantis/view.php?id=2750).
366 d.InitODE();
350 } 367 }
351 } 368 }
352 369
@@ -362,13 +379,13 @@ namespace OpenSim.Region.PhysicsModules.UbitOde
362 return; 379 return;
363 380
364 EngineType = Name; 381 EngineType = Name;
365 RegionName = scene.RegionInfo.RegionName; 382 EngineType = Name;
366 PhysicsSceneName = EngineType + "/" + RegionName; 383 PhysicsSceneName = EngineType + "/" + scene.RegionInfo.RegionName;
367 384
368 scene.RegisterModuleInterface<PhysicsScene>(this); 385 scene.RegisterModuleInterface<PhysicsScene>(this);
369 Vector3 extent = new Vector3(scene.RegionInfo.RegionSizeX, scene.RegionInfo.RegionSizeY, scene.RegionInfo.RegionSizeZ); 386 Vector3 extent = new Vector3(scene.RegionInfo.RegionSizeX, scene.RegionInfo.RegionSizeY, scene.RegionInfo.RegionSizeZ);
370 RawInitialization(); 387
371 Initialise(m_Config, extent); 388 Initialization(extent);
372 389
373 base.Initialise(scene.PhysicsRequestAsset, 390 base.Initialise(scene.PhysicsRequestAsset,
374 (scene.Heightmap != null ? scene.Heightmap.GetFloatsSerialised() : new float[scene.RegionInfo.RegionSizeX * scene.RegionInfo.RegionSizeY]), 391 (scene.Heightmap != null ? scene.Heightmap.GetFloatsSerialised() : new float[scene.RegionInfo.RegionSizeX * scene.RegionInfo.RegionSizeY]),
@@ -400,7 +417,7 @@ namespace OpenSim.Region.PhysicsModules.UbitOde
400 /// Sets many properties that ODE requires to be stable 417 /// Sets many properties that ODE requires to be stable
401 /// These settings need to be tweaked 'exactly' right or weird stuff happens. 418 /// These settings need to be tweaked 'exactly' right or weird stuff happens.
402 /// </summary> 419 /// </summary>
403 private void RawInitialization() 420 private void Initialization(Vector3 regionExtent)
404 { 421 {
405 422
406// checkThread(); 423// checkThread();
@@ -481,10 +498,7 @@ namespace OpenSim.Region.PhysicsModules.UbitOde
481 498
482 d.WorldSetAutoDisableFlag(world, false); 499 d.WorldSetAutoDisableFlag(world, false);
483 } 500 }
484 }
485 501
486 public void Initialise(IConfigSource config, Vector3 regionExtent)
487 {
488 WorldExtents.X = regionExtent.X; 502 WorldExtents.X = regionExtent.X;
489 m_regionWidth = (uint)regionExtent.X; 503 m_regionWidth = (uint)regionExtent.X;
490 WorldExtents.Y = regionExtent.Y; 504 WorldExtents.Y = regionExtent.Y;
@@ -492,7 +506,6 @@ namespace OpenSim.Region.PhysicsModules.UbitOde
492 506
493 m_suportCombine = false; 507 m_suportCombine = false;
494// checkThread(); 508// checkThread();
495 m_config = config;
496 509
497 string ode_config = d.GetConfiguration(); 510 string ode_config = d.GetConfiguration();
498 if (ode_config != null && ode_config != "") 511 if (ode_config != null && ode_config != "")
@@ -2216,9 +2229,9 @@ namespace OpenSim.Region.PhysicsModules.UbitOde
2216 { 2229 {
2217 if (m_worldOffset != Vector3.Zero && m_parentScene != null) 2230 if (m_worldOffset != Vector3.Zero && m_parentScene != null)
2218 { 2231 {
2219 if (m_parentScene is OdeScene) 2232 if (m_parentScene is ODEScene)
2220 { 2233 {
2221 ((OdeScene)m_parentScene).SetTerrain(heightMap, m_worldOffset); 2234 ((ODEScene)m_parentScene).SetTerrain(heightMap, m_worldOffset);
2222 } 2235 }
2223 } 2236 }
2224 else 2237 else