From 6c6a965320951250e7cbcc8c9875cab4b603bc76 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Thu, 1 Sep 2016 16:15:51 +0100 Subject: [PATCH] remove some MegaRegions code from physics --- .../Region/PhysicsModules/BulletS/BSScene.cs | 19 -------------- OpenSim/Region/PhysicsModules/Ode/OdeScene.cs | 24 ----------------- .../PhysicsModules/SharedBase/PhysicsScene.cs | 9 ------- .../Region/PhysicsModules/ubOde/ODEScene.cs | 26 ------------------- 4 files changed, 78 deletions(-) diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSScene.cs b/OpenSim/Region/PhysicsModules/BulletS/BSScene.cs index 9b677be80c..ee57f0ca62 100644 --- a/OpenSim/Region/PhysicsModules/BulletS/BSScene.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSScene.cs @@ -954,25 +954,6 @@ namespace OpenSim.Region.PhysicsModule.BulletS // m_log.DebugFormat("{0}: DeleteTerrain()", LogHeader); } - // Although no one seems to check this, I do support combining. - public override bool SupportsCombining() - { - return TerrainManager.SupportsCombining(); - } - // This call says I am a child to region zero in a mega-region. 'pScene' is that - // of region zero, 'offset' is my offset from regions zero's origin, and - // 'extents' is the largest XY that is handled in my region. - public override void Combine(PhysicsScene pScene, Vector3 offset, Vector3 extents) - { - TerrainManager.Combine(pScene, offset, extents); - } - - // Unhook all the combining that I know about. - public override void UnCombine(PhysicsScene pScene) - { - TerrainManager.UnCombine(pScene); - } - #endregion // Terrain public override Dictionary GetTopColliders() diff --git a/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs b/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs index 7021a0527f..ed2aad424e 100644 --- a/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs +++ b/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs @@ -258,8 +258,6 @@ namespace OpenSim.Region.PhysicsModule.ODE private Random fluidRandomizer = new Random(Environment.TickCount); - public bool m_suportCombine = true; - private uint m_regionWidth = Constants.RegionSize; private uint m_regionHeight = Constants.RegionSize; @@ -542,8 +540,6 @@ namespace OpenSim.Region.PhysicsModule.ODE WorldExtents.Y = regionExtent.Y; m_regionHeight = (uint)regionExtent.Y; - m_suportCombine = false; - nearCallback = near; m_rayCastManager = new ODERayCastRequestManager(this); @@ -1627,15 +1623,6 @@ namespace OpenSim.Region.PhysicsModule.ODE #endregion - public override void Combine(PhysicsScene pScene, Vector3 offset, Vector3 extents) - { - if (!m_suportCombine) - return; - m_worldOffset = offset; - WorldExtents = new Vector2(extents.X, extents.Y); - m_parentScene = pScene; - } - // Recovered for use by fly height. Kitto Flora internal float GetTerrainHeightAtXY(float x, float y) { @@ -1643,12 +1630,6 @@ namespace OpenSim.Region.PhysicsModule.ODE int offsetX = 0; int offsetY = 0; - if (m_suportCombine) - { - offsetX = ((int)(x / (int)Constants.RegionSize)) * (int)Constants.RegionSize; - offsetY = ((int)(y / (int)Constants.RegionSize)) * (int)Constants.RegionSize; - } - if(RegionTerrain.TryGetValue(new Vector3(offsetX,offsetY,0), out heightFieldGeom)) { if (heightFieldGeom != IntPtr.Zero) @@ -3387,11 +3368,6 @@ namespace OpenSim.Region.PhysicsModule.ODE return waterlevel; } - public override bool SupportsCombining() - { - return m_suportCombine; - } - public override void SetWaterLevel(float baseheight) { waterlevel = baseheight; diff --git a/OpenSim/Region/PhysicsModules/SharedBase/PhysicsScene.cs b/OpenSim/Region/PhysicsModules/SharedBase/PhysicsScene.cs index 65d88674cb..aa51c4e33f 100644 --- a/OpenSim/Region/PhysicsModules/SharedBase/PhysicsScene.cs +++ b/OpenSim/Region/PhysicsModules/SharedBase/PhysicsScene.cs @@ -332,15 +332,6 @@ namespace OpenSim.Region.PhysicsModules.SharedBase return false; } - public virtual bool SupportsCombining() - { - return false; - } - - public virtual void Combine(PhysicsScene pScene, Vector3 offset, Vector3 extents) {} - public virtual void CombineTerrain(float[] heightMap, Vector3 pOffset) {} - public virtual void UnCombine(PhysicsScene pScene) {} - /// /// Queue a raycast against the physics scene. /// The provided callback method will be called when the raycast is complete diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs index fc08819376..e23e3557d2 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs @@ -171,7 +171,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); public bool m_OSOdeLib = false; - public bool m_suportCombine = false; // mega suport not tested public Scene m_frameWorkScene = null; // private int threadid = 0; @@ -380,8 +379,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde WorldExtents.Y = m_frameWorkScene.RegionInfo.RegionSizeY; m_regionHeight = (uint)WorldExtents.Y; - m_suportCombine = false; - lock (OdeLock) { // Create the world and the first space @@ -1938,12 +1935,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde int offsetX = 0; int offsetY = 0; - if (m_suportCombine) - { - offsetX = ((int)(x / (int)Constants.RegionSize)) * (int)Constants.RegionSize; - offsetY = ((int)(y / (int)Constants.RegionSize)) * (int)Constants.RegionSize; - } - // get region map IntPtr heightFieldGeom = IntPtr.Zero; if (!RegionTerrain.TryGetValue(new Vector3(offsetX, offsetY, 0), out heightFieldGeom)) @@ -2076,12 +2067,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde int offsetX = 0; int offsetY = 0; - if (m_suportCombine) - { - offsetX = ((int)(x / (int)Constants.RegionSize)) * (int)Constants.RegionSize; - offsetY = ((int)(y / (int)Constants.RegionSize)) * (int)Constants.RegionSize; - } - // get region map IntPtr heightFieldGeom = IntPtr.Zero; Vector3 norm = new Vector3(0, 0, 1); @@ -2224,12 +2209,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde } } - public override void CombineTerrain(float[] heightMap, Vector3 pOffset) - { - if(m_suportCombine) - SetTerrain(heightMap, pOffset); - } - public void SetTerrain(float[] heightMap, Vector3 pOffset) { if (m_OSOdeLib) @@ -2479,11 +2458,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde return waterlevel; } - public override bool SupportsCombining() - { - return m_suportCombine; - } - public override void SetWaterLevel(float baseheight) { waterlevel = baseheight;