aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
diff options
context:
space:
mode:
authorRobert Adams2013-11-04 22:10:54 -0800
committerRobert Adams2013-11-04 22:10:54 -0800
commitf2810bf03a3e254e0ef8d9bdd639c69cc5cf570c (patch)
tree15637fe54b419ea5639a08717b1c9978714b49fe /OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
parentvarregion: remove uses of region size constant. In particular, update scene (diff)
downloadopensim-SC-f2810bf03a3e254e0ef8d9bdd639c69cc5cf570c.zip
opensim-SC-f2810bf03a3e254e0ef8d9bdd639c69cc5cf570c.tar.gz
opensim-SC-f2810bf03a3e254e0ef8d9bdd639c69cc5cf570c.tar.bz2
opensim-SC-f2810bf03a3e254e0ef8d9bdd639c69cc5cf570c.tar.xz
varregion: add plumbing to pass region size from Scene down to the
physics engine. Older physics engines will default to the legacy region size. Update BulletSim to use the new region size information.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSScene.cs12
1 files changed, 10 insertions, 2 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
index b3dfa41..83ef1f6 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
@@ -210,6 +210,14 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
210 210
211 public override void Initialise(IMesher meshmerizer, IConfigSource config) 211 public override void Initialise(IMesher meshmerizer, IConfigSource config)
212 { 212 {
213 m_log.ErrorFormat("{0} WARNING WARNING WARNING! BulletSim initialized without region extent specification. Terrain will be messed up.");
214 Vector3 regionExtent = new Vector3( Constants.RegionSize, Constants.RegionSize, Constants.RegionSize);
215 Initialise(meshmerizer, config, regionExtent);
216
217 }
218
219 public override void Initialise(IMesher meshmerizer, IConfigSource config, Vector3 regionExtent)
220 {
213 mesher = meshmerizer; 221 mesher = meshmerizer;
214 _taintOperations = new List<TaintCallbackEntry>(); 222 _taintOperations = new List<TaintCallbackEntry>();
215 _postTaintOperations = new Dictionary<string, TaintCallbackEntry>(); 223 _postTaintOperations = new Dictionary<string, TaintCallbackEntry>();
@@ -250,13 +258,13 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
250 // a child in a mega-region. 258 // a child in a mega-region.
251 // Bullet actually doesn't care about the extents of the simulated 259 // Bullet actually doesn't care about the extents of the simulated
252 // area. It tracks active objects no matter where they are. 260 // area. It tracks active objects no matter where they are.
253 Vector3 worldExtent = new Vector3(Constants.RegionSize, Constants.RegionSize, Constants.RegionHeight); 261 Vector3 worldExtent = regionExtent;
254 262
255 World = PE.Initialize(worldExtent, Params, m_maxCollisionsPerFrame, ref m_collisionArray, m_maxUpdatesPerFrame, ref m_updateArray); 263 World = PE.Initialize(worldExtent, Params, m_maxCollisionsPerFrame, ref m_collisionArray, m_maxUpdatesPerFrame, ref m_updateArray);
256 264
257 Constraints = new BSConstraintCollection(World); 265 Constraints = new BSConstraintCollection(World);
258 266
259 TerrainManager = new BSTerrainManager(this); 267 TerrainManager = new BSTerrainManager(this, worldExtent);
260 TerrainManager.CreateInitialGroundPlaneAndTerrain(); 268 TerrainManager.CreateInitialGroundPlaneAndTerrain();
261 269
262 // Put some informational messages into the log file. 270 // Put some informational messages into the log file.