aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/PhysicsModules
diff options
context:
space:
mode:
authorUbitUmarov2015-10-22 16:20:19 +0100
committerUbitUmarov2015-10-22 16:20:19 +0100
commit7aaa84515fef4ba6138cb568a08b9b02502142f6 (patch)
treed6b2420fb0b4cc325f4974c660d25c4e215be2be /OpenSim/Region/PhysicsModules
parentMark XAssetService obsolete and warn users. (diff)
downloadopensim-SC_OLD-7aaa84515fef4ba6138cb568a08b9b02502142f6.zip
opensim-SC_OLD-7aaa84515fef4ba6138cb568a08b9b02502142f6.tar.gz
opensim-SC_OLD-7aaa84515fef4ba6138cb568a08b9b02502142f6.tar.bz2
opensim-SC_OLD-7aaa84515fef4ba6138cb568a08b9b02502142f6.tar.xz
rename terrain for opensim and respective configuration flag that a future costumized ODE library may have
Diffstat (limited to 'OpenSim/Region/PhysicsModules')
-rw-r--r--OpenSim/Region/PhysicsModules/ubOde/ODEApi.cs36
-rw-r--r--OpenSim/Region/PhysicsModules/ubOde/ODEModule.cs8
-rw-r--r--OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs27
3 files changed, 37 insertions, 34 deletions
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEApi.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEApi.cs
index 2ebd964..daf3af1 100644
--- a/OpenSim/Region/PhysicsModules/ubOde/ODEApi.cs
+++ b/OpenSim/Region/PhysicsModules/ubOde/ODEApi.cs
@@ -207,7 +207,7 @@ namespace OdeAPI
207 public delegate dReal HeightfieldGetHeight(IntPtr p_user_data, int x, int z); 207 public delegate dReal HeightfieldGetHeight(IntPtr p_user_data, int x, int z);
208 208
209 [UnmanagedFunctionPointer(CallingConvention.Cdecl)] 209 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
210 public delegate dReal ubTerrainGetHeight(IntPtr p_user_data, int x, int z); 210 public delegate dReal OSTerrainGetHeight(IntPtr p_user_data, int x, int z);
211 211
212 [UnmanagedFunctionPointer(CallingConvention.Cdecl)] 212 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
213 public delegate void NearCallback(IntPtr data, IntPtr geom1, IntPtr geom2); 213 public delegate void NearCallback(IntPtr data, IntPtr geom1, IntPtr geom2);
@@ -734,12 +734,12 @@ namespace OdeAPI
734 return CreateiHeightfield(space, data, bPlaceable); 734 return CreateiHeightfield(space, data, bPlaceable);
735 } 735 }
736 736
737 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateubTerrain"), SuppressUnmanagedCodeSecurity] 737 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateOSTerrain"), SuppressUnmanagedCodeSecurity]
738 public static extern IntPtr CreateiubTerrain(IntPtr space, IntPtr data, int bPlaceable); 738 public static extern IntPtr CreateiOSTerrain(IntPtr space, IntPtr data, int bPlaceable);
739 public static IntPtr CreateubTerrain(IntPtr space, IntPtr data, int bPlaceable) 739 public static IntPtr CreateOSTerrain(IntPtr space, IntPtr data, int bPlaceable)
740 { 740 {
741 NTotalGeoms++; 741 NTotalGeoms++;
742 return CreateiubTerrain(space, data, bPlaceable); 742 return CreateiOSTerrain(space, data, bPlaceable);
743 } 743 }
744 744
745 745
@@ -1021,29 +1021,29 @@ namespace OdeAPI
1021 1021
1022 1022
1023 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomUbitTerrainDataBuild"), SuppressUnmanagedCodeSecurity] 1023 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomUbitTerrainDataBuild"), SuppressUnmanagedCodeSecurity]
1024 public static extern void GeomubTerrainDataBuild(IntPtr d, float[] pHeightData, int bCopyHeightData, 1024 public static extern void GeomOSTerrainDataBuild(IntPtr d, float[] pHeightData, int bCopyHeightData,
1025 dReal sampleSize, int widthSamples, int depthSamples, 1025 dReal sampleSize, int widthSamples, int depthSamples,
1026 dReal offset, dReal thickness, int bWrap); 1026 dReal offset, dReal thickness, int bWrap);
1027 1027
1028 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomubTerrainDataBuild"), SuppressUnmanagedCodeSecurity] 1028 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomOSTerrainDataBuild"), SuppressUnmanagedCodeSecurity]
1029 public static extern void GeomubTerrainDataBuild(IntPtr d, IntPtr pHeightData, int bCopyHeightData, 1029 public static extern void GeomOSTerrainDataBuild(IntPtr d, IntPtr pHeightData, int bCopyHeightData,
1030 dReal sampleSize, int widthSamples, int depthSamples, 1030 dReal sampleSize, int widthSamples, int depthSamples,
1031 dReal thickness, int bWrap); 1031 dReal thickness, int bWrap);
1032 1032
1033 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomubTerrainDataCreate"), SuppressUnmanagedCodeSecurity] 1033 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomOSTerrainDataCreate"), SuppressUnmanagedCodeSecurity]
1034 public static extern IntPtr GeomubTerrainDataCreate(); 1034 public static extern IntPtr GeomOSTerrainDataCreate();
1035 1035
1036 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomubTerrainDataDestroy"), SuppressUnmanagedCodeSecurity] 1036 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomOSTerrainDataDestroy"), SuppressUnmanagedCodeSecurity]
1037 public static extern void GeomubTerrainDataDestroy(IntPtr d); 1037 public static extern void GeomOSTerrainDataDestroy(IntPtr d);
1038 1038
1039 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomubTerrainDataSetBounds"), SuppressUnmanagedCodeSecurity] 1039 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomOSTerrainDataSetBounds"), SuppressUnmanagedCodeSecurity]
1040 public static extern void GeomubTerrainDataSetBounds(IntPtr d, dReal minHeight, dReal maxHeight); 1040 public static extern void GeomOSTerrainDataSetBounds(IntPtr d, dReal minHeight, dReal maxHeight);
1041 1041
1042 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomubTerrainGetHeightfieldData"), SuppressUnmanagedCodeSecurity] 1042 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomOSTerrainGetHeightfieldData"), SuppressUnmanagedCodeSecurity]
1043 public static extern IntPtr GeomubTerrainGetHeightfieldData(IntPtr g); 1043 public static extern IntPtr GeomOSTerrainGetHeightfieldData(IntPtr g);
1044 1044
1045 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomubTerrainSetHeightfieldData"), SuppressUnmanagedCodeSecurity] 1045 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomOSTerrainSetHeightfieldData"), SuppressUnmanagedCodeSecurity]
1046 public static extern void GeomubTerrainSetHeightfieldData(IntPtr g, IntPtr d); 1046 public static extern void GeomOSTerrainSetHeightfieldData(IntPtr g, IntPtr d);
1047 1047
1048 1048
1049 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomIsEnabled"), SuppressUnmanagedCodeSecurity] 1049 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomIsEnabled"), SuppressUnmanagedCodeSecurity]
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEModule.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEModule.cs
index 44bf17f..bd66b4d 100644
--- a/OpenSim/Region/PhysicsModules/ubOde/ODEModule.cs
+++ b/OpenSim/Region/PhysicsModules/ubOde/ODEModule.cs
@@ -18,7 +18,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
18 private bool m_Enabled = false; 18 private bool m_Enabled = false;
19 private IConfigSource m_config; 19 private IConfigSource m_config;
20 private ODEScene m_scene; 20 private ODEScene m_scene;
21 private bool ubOdeLib; 21 private bool OSOdeLib;
22 22
23 #region INonSharedRegionModule 23 #region INonSharedRegionModule
24 24
@@ -67,13 +67,13 @@ namespace OpenSim.Region.PhysicsModule.ubOde
67 { 67 {
68 m_log.InfoFormat("[ubODE] ode library configuration: {0}", ode_config); 68 m_log.InfoFormat("[ubODE] ode library configuration: {0}", ode_config);
69 // ubODE still not avaiable 69 // ubODE still not avaiable
70 if (ode_config.Contains("ubODE")) 70 if (ode_config.Contains("ODE_OPENSIM"))
71 { 71 {
72 ubOdeLib = true; 72 OSOdeLib = true;
73 } 73 }
74 } 74 }
75 75
76 m_scene = new ODEScene(scene, m_config, Name, ubOdeLib); 76 m_scene = new ODEScene(scene, m_config, Name, OSOdeLib);
77 } 77 }
78 78
79 public void RemoveRegion(Scene scene) 79 public void RemoveRegion(Scene scene)
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs
index 5adf374..103304d 100644
--- a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs
+++ b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs
@@ -169,7 +169,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
169 { 169 {
170 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 170 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
171 171
172 public bool m_ubOdeLib = false; 172 public bool m_OSOdeLib = false;
173 public bool m_suportCombine = false; // mega suport not tested 173 public bool m_suportCombine = false; // mega suport not tested
174 public Scene m_frameWorkScene = null; 174 public Scene m_frameWorkScene = null;
175 175
@@ -322,7 +322,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
322 322
323 IConfig physicsconfig = null; 323 IConfig physicsconfig = null;
324 324
325 public ODEScene(Scene pscene, IConfigSource psourceconfig, string pname, bool pubOdeLib) 325 public ODEScene(Scene pscene, IConfigSource psourceconfig, string pname, bool pOSOdeLib)
326 { 326 {
327 OdeLock = new Object(); 327 OdeLock = new Object();
328 328
@@ -330,7 +330,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde
330 PhysicsSceneName = EngineType + "/" + pscene.RegionInfo.RegionName; 330 PhysicsSceneName = EngineType + "/" + pscene.RegionInfo.RegionName;
331 331
332 m_config = psourceconfig; 332 m_config = psourceconfig;
333 m_ubOdeLib = pubOdeLib; 333 m_OSOdeLib = pOSOdeLib;
334
335// m_OSOdeLib = false; //debug
336
334 m_frameWorkScene = pscene; 337 m_frameWorkScene = pscene;
335 338
336 m_frameWorkScene.RegisterModuleInterface<PhysicsScene>(this); 339 m_frameWorkScene.RegisterModuleInterface<PhysicsScene>(this);
@@ -1920,7 +1923,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1920 int regsizeY = (int)m_regionHeight + 3; // map size see setterrain number of samples 1923 int regsizeY = (int)m_regionHeight + 3; // map size see setterrain number of samples
1921 int regsize = regsizeX; 1924 int regsize = regsizeX;
1922 1925
1923 if (m_ubOdeLib) 1926 if (m_OSOdeLib)
1924 { 1927 {
1925 if (x < regsizeX - 1) 1928 if (x < regsizeX - 1)
1926 { 1929 {
@@ -2064,7 +2067,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
2064 int ystep = regsizeX; 2067 int ystep = regsizeX;
2065 bool firstTri = false; 2068 bool firstTri = false;
2066 2069
2067 if (m_ubOdeLib) 2070 if (m_OSOdeLib)
2068 { 2071 {
2069 if (x < regsizeX - 1) 2072 if (x < regsizeX - 1)
2070 { 2073 {
@@ -2176,8 +2179,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde
2176 2179
2177 public void SetTerrain(float[] heightMap, Vector3 pOffset) 2180 public void SetTerrain(float[] heightMap, Vector3 pOffset)
2178 { 2181 {
2179 if (m_ubOdeLib) 2182 if (m_OSOdeLib)
2180 ubSetTerrain(heightMap, pOffset); 2183 OSSetTerrain(heightMap, pOffset);
2181 else 2184 else
2182 OriSetTerrain(heightMap, pOffset); 2185 OriSetTerrain(heightMap, pOffset);
2183 } 2186 }
@@ -2302,7 +2305,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
2302 } 2305 }
2303 } 2306 }
2304 2307
2305 public void ubSetTerrain(float[] heightMap, Vector3 pOffset) 2308 public void OSSetTerrain(float[] heightMap, Vector3 pOffset)
2306 { 2309 {
2307 // assumes 1m size grid and constante size square regions 2310 // assumes 1m size grid and constante size square regions
2308 // needs to know about sims around in future 2311 // needs to know about sims around in future
@@ -2376,7 +2379,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
2376 } 2379 }
2377 } 2380 }
2378 } 2381 }
2379 IntPtr HeightmapData = d.GeomubTerrainDataCreate(); 2382 IntPtr HeightmapData = d.GeomOSTerrainDataCreate();
2380 2383
2381 const int wrap = 0; 2384 const int wrap = 0;
2382 float thickness = hfmin; 2385 float thickness = hfmin;
@@ -2385,12 +2388,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde
2385 2388
2386 GCHandle _heightmaphandler = GCHandle.Alloc(_heightmap, GCHandleType.Pinned); 2389 GCHandle _heightmaphandler = GCHandle.Alloc(_heightmap, GCHandleType.Pinned);
2387 2390
2388 d.GeomubTerrainDataBuild(HeightmapData, _heightmaphandler.AddrOfPinnedObject(), 0, 1.0f, 2391 d.GeomOSTerrainDataBuild(HeightmapData, _heightmaphandler.AddrOfPinnedObject(), 0, 1.0f,
2389 (int)heightmapWidthSamples, (int)heightmapHeightSamples, 2392 (int)heightmapWidthSamples, (int)heightmapHeightSamples,
2390 thickness, wrap); 2393 thickness, wrap);
2391 2394
2392// d.GeomubTerrainDataSetBounds(HeightmapData, hfmin - 1, hfmax + 1); 2395// d.GeomOSTerrainDataSetBounds(HeightmapData, hfmin - 1, hfmax + 1);
2393 GroundGeom = d.CreateubTerrain(GroundSpace, HeightmapData, 1); 2396 GroundGeom = d.CreateOSTerrain(GroundSpace, HeightmapData, 1);
2394 if (GroundGeom != IntPtr.Zero) 2397 if (GroundGeom != IntPtr.Zero)
2395 { 2398 {
2396 d.GeomSetCategoryBits(GroundGeom, (uint)(CollisionCategories.Land)); 2399 d.GeomSetCategoryBits(GroundGeom, (uint)(CollisionCategories.Land));