diff options
author | UbitUmarov | 2015-09-08 18:13:15 +0100 |
---|---|---|
committer | UbitUmarov | 2015-09-08 18:13:15 +0100 |
commit | ecc19698575a1d0705665f9551a8d69afcad1570 (patch) | |
tree | ae5db0cdc8e8d58acb7d6b043f28cdd122bba269 /OpenSim/Region/PhysicsModules/UbitOde/OdeScene.cs | |
parent | opps my files? (diff) | |
download | opensim-SC_OLD-ecc19698575a1d0705665f9551a8d69afcad1570.zip opensim-SC_OLD-ecc19698575a1d0705665f9551a8d69afcad1570.tar.gz opensim-SC_OLD-ecc19698575a1d0705665f9551a8d69afcad1570.tar.bz2 opensim-SC_OLD-ecc19698575a1d0705665f9551a8d69afcad1570.tar.xz |
more on compile..
Diffstat (limited to 'OpenSim/Region/PhysicsModules/UbitOde/OdeScene.cs')
-rw-r--r-- | OpenSim/Region/PhysicsModules/UbitOde/OdeScene.cs | 45 |
1 files changed, 29 insertions, 16 deletions
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; | |||
37 | using System.Diagnostics; | 37 | using System.Diagnostics; |
38 | using log4net; | 38 | using log4net; |
39 | using Nini.Config; | 39 | using Nini.Config; |
40 | using Mono.Addins; | ||
40 | using OdeAPI; | 41 | using OdeAPI; |
41 | using OpenSim.Framework; | 42 | using OpenSim.Framework; |
43 | using OpenSim.Region.Framework.Scenes; | ||
42 | using OpenSim.Region.Framework.Interfaces; | 44 | using OpenSim.Region.Framework.Interfaces; |
43 | using OpenSim.Region.PhysicsModules.SharedBase; | 45 | using OpenSim.Region.PhysicsModules.SharedBase; |
44 | using OpenMetaverse; | 46 | using 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 |