diff options
author | Robert Adams | 2014-01-29 06:44:14 -0800 |
---|---|---|
committer | Robert Adams | 2014-01-29 06:44:14 -0800 |
commit | 0842e2e15b6af6f940648b0b74488f2da88ce920 (patch) | |
tree | e836bebbc79f4a05d13bb370bf7ad3db28eb9aa5 | |
parent | Merge branch 'master' of ssh://opensimulator.org/var/git/opensim (diff) | |
download | opensim-SC_OLD-0842e2e15b6af6f940648b0b74488f2da88ce920.zip opensim-SC_OLD-0842e2e15b6af6f940648b0b74488f2da88ce920.tar.gz opensim-SC_OLD-0842e2e15b6af6f940648b0b74488f2da88ce920.tar.bz2 opensim-SC_OLD-0842e2e15b6af6f940648b0b74488f2da88ce920.tar.xz |
BulletSim: default physical terrain implementation to heightmap.
It originally looked like mesh terrain would perform better for vehicles
but, after much use, heightmap is the clear winner.
Force terrain implementation to heightmap if the physics region is
larger than legacy region size. This solves running out of memory for
very large regions.
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSParam.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | 8 | ||||
-rw-r--r-- | bin/OpenSimDefaults.ini | 4 |
3 files changed, 11 insertions, 3 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs index 834228e..d993e6a 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs | |||
@@ -538,7 +538,7 @@ public static class BSParam | |||
538 | (s,o) => { s.PE.SetContactProcessingThreshold(o.PhysBody, ContactProcessingThreshold); } ), | 538 | (s,o) => { s.PE.SetContactProcessingThreshold(o.PhysBody, ContactProcessingThreshold); } ), |
539 | 539 | ||
540 | new ParameterDefn<float>("TerrainImplementation", "Type of shape to use for terrain (0=heightmap, 1=mesh)", | 540 | new ParameterDefn<float>("TerrainImplementation", "Type of shape to use for terrain (0=heightmap, 1=mesh)", |
541 | (float)BSTerrainPhys.TerrainImplementation.Mesh ), | 541 | (float)BSTerrainPhys.TerrainImplementation.Heightmap ), |
542 | new ParameterDefn<int>("TerrainMeshMagnification", "Number of times the 256x256 heightmap is multiplied to create the terrain mesh" , | 542 | new ParameterDefn<int>("TerrainMeshMagnification", "Number of times the 256x256 heightmap is multiplied to create the terrain mesh" , |
543 | 2 ), | 543 | 2 ), |
544 | new ParameterDefn<float>("TerrainFriction", "Factor to reduce movement against terrain surface" , | 544 | new ParameterDefn<float>("TerrainFriction", "Factor to reduce movement against terrain surface" , |
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs index fe014fc..2d2e55f 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | |||
@@ -235,6 +235,14 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
235 | // Set default values for physics parameters plus any overrides from the ini file | 235 | // Set default values for physics parameters plus any overrides from the ini file |
236 | GetInitialParameterValues(config); | 236 | GetInitialParameterValues(config); |
237 | 237 | ||
238 | // Force some parameters to values depending on other configurations | ||
239 | // Only use heightmap terrain implementation if terrain larger than legacy size | ||
240 | if ((uint)regionExtent.X > Constants.RegionSize || (uint)regionExtent.Y > Constants.RegionSize) | ||
241 | { | ||
242 | m_log.WarnFormat("{0} Forcing terrain implementation to heightmap for large region", LogHeader); | ||
243 | BSParam.TerrainImplementation = (float)BSTerrainPhys.TerrainImplementation.Heightmap; | ||
244 | } | ||
245 | |||
238 | // Get the connection to the physics engine (could be native or one of many DLLs) | 246 | // Get the connection to the physics engine (could be native or one of many DLLs) |
239 | PE = SelectUnderlyingBulletEngine(BulletEngineName); | 247 | PE = SelectUnderlyingBulletEngine(BulletEngineName); |
240 | 248 | ||
diff --git a/bin/OpenSimDefaults.ini b/bin/OpenSimDefaults.ini index df94239..026f285 100644 --- a/bin/OpenSimDefaults.ini +++ b/bin/OpenSimDefaults.ini | |||
@@ -1001,10 +1001,10 @@ | |||
1001 | 1001 | ||
1002 | ; Terrain implementation can use either Bullet's heightField or BulletSim can build | 1002 | ; Terrain implementation can use either Bullet's heightField or BulletSim can build |
1003 | ; a mesh. 0=heightField, 1=mesh | 1003 | ; a mesh. 0=heightField, 1=mesh |
1004 | TerrainImplementation = 1 | 1004 | TerrainImplementation = 0 |
1005 | ; For mesh terrain, the detail of the created mesh. '1' gives 256x256 (heightfield | 1005 | ; For mesh terrain, the detail of the created mesh. '1' gives 256x256 (heightfield |
1006 | ; resolution). '2' gives 512x512. Etc. Cannot be larger than '4'. Higher | 1006 | ; resolution). '2' gives 512x512. Etc. Cannot be larger than '4'. Higher |
1007 | ; magnification uses lots of memory. | 1007 | ; magnifications use lots of memory. |
1008 | TerrainMeshMagnification = 2 | 1008 | TerrainMeshMagnification = 2 |
1009 | 1009 | ||
1010 | ; Avatar physics height adjustments. | 1010 | ; Avatar physics height adjustments. |