diff options
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSScene.cs')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs index b3dfa41..2d2e55f 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | |||
@@ -208,8 +208,17 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
208 | Name = EngineType + "/" + RegionName; | 208 | Name = EngineType + "/" + RegionName; |
209 | } | 209 | } |
210 | 210 | ||
211 | // Old version of initialization that assumes legacy sized regions (256x256) | ||
211 | public override void Initialise(IMesher meshmerizer, IConfigSource config) | 212 | public override void Initialise(IMesher meshmerizer, IConfigSource config) |
212 | { | 213 | { |
214 | m_log.ErrorFormat("{0} WARNING WARNING WARNING! BulletSim initialized without region extent specification. Terrain will be messed up."); | ||
215 | Vector3 regionExtent = new Vector3( Constants.RegionSize, Constants.RegionSize, Constants.RegionSize); | ||
216 | Initialise(meshmerizer, config, regionExtent); | ||
217 | |||
218 | } | ||
219 | |||
220 | public override void Initialise(IMesher meshmerizer, IConfigSource config, Vector3 regionExtent) | ||
221 | { | ||
213 | mesher = meshmerizer; | 222 | mesher = meshmerizer; |
214 | _taintOperations = new List<TaintCallbackEntry>(); | 223 | _taintOperations = new List<TaintCallbackEntry>(); |
215 | _postTaintOperations = new Dictionary<string, TaintCallbackEntry>(); | 224 | _postTaintOperations = new Dictionary<string, TaintCallbackEntry>(); |
@@ -226,6 +235,14 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
226 | // 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 |
227 | GetInitialParameterValues(config); | 236 | GetInitialParameterValues(config); |
228 | 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 | |||
229 | // 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) |
230 | PE = SelectUnderlyingBulletEngine(BulletEngineName); | 247 | PE = SelectUnderlyingBulletEngine(BulletEngineName); |
231 | 248 | ||
@@ -250,13 +267,13 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
250 | // a child in a mega-region. | 267 | // a child in a mega-region. |
251 | // Bullet actually doesn't care about the extents of the simulated | 268 | // Bullet actually doesn't care about the extents of the simulated |
252 | // area. It tracks active objects no matter where they are. | 269 | // area. It tracks active objects no matter where they are. |
253 | Vector3 worldExtent = new Vector3(Constants.RegionSize, Constants.RegionSize, Constants.RegionHeight); | 270 | Vector3 worldExtent = regionExtent; |
254 | 271 | ||
255 | World = PE.Initialize(worldExtent, Params, m_maxCollisionsPerFrame, ref m_collisionArray, m_maxUpdatesPerFrame, ref m_updateArray); | 272 | World = PE.Initialize(worldExtent, Params, m_maxCollisionsPerFrame, ref m_collisionArray, m_maxUpdatesPerFrame, ref m_updateArray); |
256 | 273 | ||
257 | Constraints = new BSConstraintCollection(World); | 274 | Constraints = new BSConstraintCollection(World); |
258 | 275 | ||
259 | TerrainManager = new BSTerrainManager(this); | 276 | TerrainManager = new BSTerrainManager(this, worldExtent); |
260 | TerrainManager.CreateInitialGroundPlaneAndTerrain(); | 277 | TerrainManager.CreateInitialGroundPlaneAndTerrain(); |
261 | 278 | ||
262 | // Put some informational messages into the log file. | 279 | // Put some informational messages into the log file. |