From ecc19698575a1d0705665f9551a8d69afcad1570 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Tue, 8 Sep 2015 18:13:15 +0100 Subject: more on compile.. --- OpenSim/Region/PhysicsModules/Ode/OdeScene.cs | 14 +------ .../Region/PhysicsModules/UbitOde/ODECharacter.cs | 4 +- .../Region/PhysicsModules/UbitOde/ODEDynamics.cs | 2 +- .../Region/PhysicsModules/UbitOde/ODEMeshWorker.cs | 4 +- OpenSim/Region/PhysicsModules/UbitOde/ODEPrim.cs | 4 +- .../UbitOde/ODERayCastRequestManager.cs | 4 +- .../Region/PhysicsModules/UbitOde/ODESitAvatar.cs | 4 +- OpenSim/Region/PhysicsModules/UbitOde/OdeScene.cs | 45 ++++++++++++++-------- 8 files changed, 42 insertions(+), 39 deletions(-) (limited to 'OpenSim') diff --git a/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs b/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs index b00a5ab..1d1b710 100644 --- a/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs +++ b/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs @@ -671,18 +671,8 @@ namespace OpenSim.Region.PhysicsModule.ODE } #endif - public void Initialise(IMesher meshmerizer, IConfigSource config, Vector3 regionExtent) - { - WorldExtents.X = regionExtent.X; - m_regionWidth = (uint)regionExtent.X; - WorldExtents.Y = regionExtent.Y; - m_regionHeight = (uint)regionExtent.Y; - m_suportCombine = false; - Initialise(meshmerizer, config); - } - - // Initialize the mesh plugin - public void Initialise(IMesher meshmerizer, IConfigSource config) + // Initialize from configs + private void InitialiseFromConfig(IConfigSource config) { InitializeExtraStats(); 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 ); // we do land collisions not ode | CollisionCategories.Land); public IntPtr Body = IntPtr.Zero; - private OdeScene _parent_scene; + private ODEScene _parent_scene; private IntPtr capsule = IntPtr.Zero; public IntPtr collider = IntPtr.Zero; @@ -157,7 +157,7 @@ namespace OpenSim.Region.PhysicsModules.UbitOde float mu; - public OdeCharacter(uint localID, String avName, OdeScene parent_scene, Vector3 pos, Vector3 pSize, float pfeetOffset, float density, float walk_divisor, float rundivisor) + public OdeCharacter(uint localID, String avName, ODEScene parent_scene, Vector3 pos, Vector3 pSize, float pfeetOffset, float density, float walk_divisor, float rundivisor) { m_uuid = UUID.Random(); 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 } private OdePrim rootPrim; - private OdeScene _pParentScene; + private ODEScene _pParentScene; // Vehicle properties // 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 { private ILog m_log; - private OdeScene m_scene; + private ODEScene m_scene; private IMesher m_mesher; public bool meshSculptedPrim = true; @@ -85,7 +85,7 @@ namespace OpenSim.Region.PhysicsModules.UbitOde private Thread m_thread; - public ODEMeshWorker(OdeScene pScene, ILog pLog, IMesher pMesher, IConfig pConfig) + public ODEMeshWorker(ODEScene pScene, ILog pLog, IMesher pMesher, IConfig pConfig) { m_scene = pScene; 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 private UUID? m_assetID; private MeshState m_meshState; - public OdeScene _parent_scene; + public ODEScene _parent_scene; /// /// The physics space which contains prim geometry @@ -1069,7 +1069,7 @@ namespace OpenSim.Region.PhysicsModules.UbitOde return false; } - public OdePrim(String primName, OdeScene parent_scene, Vector3 pos, Vector3 size, + public OdePrim(String primName, ODEScene parent_scene, Vector3 pos, Vector3 size, Quaternion rotation, PrimitiveBaseShape pbs, bool pisPhysical,bool pisPhantom,byte _shapeType,uint plocalID) { 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 /// /// Scene that created this object. /// - private OdeScene m_scene; + private ODEScene m_scene; IntPtr ray; // the ray. we only need one for our lifetime IntPtr Sphere; @@ -73,7 +73,7 @@ namespace OpenSim.Region.PhysicsModules.UbitOde private RayFilterFlags CurrentRayFilter; private int CurrentMaxCount; - public ODERayCastRequestManager(OdeScene pScene) + public ODERayCastRequestManager(ODEScene pScene) { m_scene = pScene; 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 /// public class ODESitAvatar { - private OdeScene m_scene; + private ODEScene m_scene; private ODERayCastRequestManager m_raymanager; - public ODESitAvatar(OdeScene pScene, ODERayCastRequestManager raymanager) + public ODESitAvatar(ODEScene pScene, ODERayCastRequestManager raymanager) { m_scene = pScene; 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; using System.Diagnostics; using log4net; using Nini.Config; +using Mono.Addins; using OdeAPI; using OpenSim.Framework; +using OpenSim.Region.Framework.Scenes; using OpenSim.Region.Framework.Interfaces; using OpenSim.Region.PhysicsModules.SharedBase; using OpenMetaverse; @@ -163,11 +165,13 @@ namespace OpenSim.Region.PhysicsModules.UbitOde public Object arg; } - - public class OdeScene : PhysicsScene, INonSharedRegionModule + [Extension(Path = "/OpenSim/RegionModules", NodeName = "RegionModule", Id = "UBITODEPhysicsScene")] + public class ODEScene : PhysicsScene, INonSharedRegionModule { - private readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType.ToString() + "." + sceneIdentifier); + private readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType.ToString()); + private bool m_Enabled = false; + // private Dictionary m_storedCollisions = new Dictionary(); public bool OdeUbitLib = false; @@ -300,7 +304,7 @@ namespace OpenSim.Region.PhysicsModules.UbitOde public IMesher mesher; - private IConfigSource m_config; + public IConfigSource m_config; public bool physics_logging = false; public int physics_logging_interval = 0; @@ -346,7 +350,20 @@ namespace OpenSim.Region.PhysicsModules.UbitOde if (physics == Name) { m_Enabled = true; - m_Config = source; + m_config = source; + + // We do this so that OpenSimulator on Windows loads the correct native ODE library depending on whether + // it's running as a 32-bit process or a 64-bit one. By invoking LoadLibary here, later DLLImports + // will find it already loaded later on. + // + // This isn't necessary for other platforms (e.g. Mac OSX and Linux) since the DLL used can be + // controlled in Ode.NET.dll.config + if (Util.IsWindows()) + Util.LoadArchSpecificWindowsDll("ode.dll"); + + // Initializing ODE only when a scene is created allows alternative ODE plugins to co-habit (according to + // http://opensimulator.org/mantis/view.php?id=2750). + d.InitODE(); } } @@ -362,13 +379,13 @@ namespace OpenSim.Region.PhysicsModules.UbitOde return; EngineType = Name; - RegionName = scene.RegionInfo.RegionName; - PhysicsSceneName = EngineType + "/" + RegionName; + EngineType = Name; + PhysicsSceneName = EngineType + "/" + scene.RegionInfo.RegionName; scene.RegisterModuleInterface(this); Vector3 extent = new Vector3(scene.RegionInfo.RegionSizeX, scene.RegionInfo.RegionSizeY, scene.RegionInfo.RegionSizeZ); - RawInitialization(); - Initialise(m_Config, extent); + + Initialization(extent); base.Initialise(scene.PhysicsRequestAsset, (scene.Heightmap != null ? scene.Heightmap.GetFloatsSerialised() : new float[scene.RegionInfo.RegionSizeX * scene.RegionInfo.RegionSizeY]), @@ -400,7 +417,7 @@ namespace OpenSim.Region.PhysicsModules.UbitOde /// Sets many properties that ODE requires to be stable /// These settings need to be tweaked 'exactly' right or weird stuff happens. /// - private void RawInitialization() + private void Initialization(Vector3 regionExtent) { // checkThread(); @@ -481,10 +498,7 @@ namespace OpenSim.Region.PhysicsModules.UbitOde d.WorldSetAutoDisableFlag(world, false); } - } - public void Initialise(IConfigSource config, Vector3 regionExtent) - { WorldExtents.X = regionExtent.X; m_regionWidth = (uint)regionExtent.X; WorldExtents.Y = regionExtent.Y; @@ -492,7 +506,6 @@ namespace OpenSim.Region.PhysicsModules.UbitOde m_suportCombine = false; // checkThread(); - m_config = config; string ode_config = d.GetConfiguration(); if (ode_config != null && ode_config != "") @@ -2216,9 +2229,9 @@ namespace OpenSim.Region.PhysicsModules.UbitOde { if (m_worldOffset != Vector3.Zero && m_parentScene != null) { - if (m_parentScene is OdeScene) + if (m_parentScene is ODEScene) { - ((OdeScene)m_parentScene).SetTerrain(heightMap, m_worldOffset); + ((ODEScene)m_parentScene).SetTerrain(heightMap, m_worldOffset); } } else -- cgit v1.1