aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSScene.cs13
1 files changed, 7 insertions, 6 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
index 7b4802e..2f55ba4 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
@@ -232,15 +232,15 @@ public class BSScene : PhysicsScene, IPhysicsParameters
232 } 232 }
233 233
234 // If Debug logging level, enable logging from the unmanaged code 234 // If Debug logging level, enable logging from the unmanaged code
235 m_DebugLogCallbackHandle = null;
235 if (m_log.IsDebugEnabled || PhysicsLogging.Enabled) 236 if (m_log.IsDebugEnabled || PhysicsLogging.Enabled)
236 { 237 {
237 m_log.DebugFormat("{0}: Initialize: Setting debug callback for unmanaged code", LogHeader); 238 m_log.DebugFormat("{0}: Initialize: Setting debug callback for unmanaged code", LogHeader);
238 if (PhysicsLogging.Enabled) 239 if (PhysicsLogging.Enabled)
240 // The handle is saved in a variable to make sure it doesn't get freed after this call
239 m_DebugLogCallbackHandle = new BulletSimAPI.DebugLogCallback(BulletLoggerPhysLog); 241 m_DebugLogCallbackHandle = new BulletSimAPI.DebugLogCallback(BulletLoggerPhysLog);
240 else 242 else
241 m_DebugLogCallbackHandle = new BulletSimAPI.DebugLogCallback(BulletLogger); 243 m_DebugLogCallbackHandle = new BulletSimAPI.DebugLogCallback(BulletLogger);
242 // The handle is saved in a variable to make sure it doesn't get freed after this call
243 BulletSimAPI.SetDebugLogCallback(m_DebugLogCallbackHandle);
244 } 244 }
245 245
246 // Get the version of the DLL 246 // Get the version of the DLL
@@ -257,7 +257,8 @@ public class BSScene : PhysicsScene, IPhysicsParameters
257 // m_log.DebugFormat("{0}: Initialize: Calling BulletSimAPI.Initialize.", LogHeader); 257 // m_log.DebugFormat("{0}: Initialize: Calling BulletSimAPI.Initialize.", LogHeader);
258 WorldID = BulletSimAPI.Initialize(worldExtent, m_paramsHandle.AddrOfPinnedObject(), 258 WorldID = BulletSimAPI.Initialize(worldExtent, m_paramsHandle.AddrOfPinnedObject(),
259 m_maxCollisionsPerFrame, m_collisionArrayPinnedHandle.AddrOfPinnedObject(), 259 m_maxCollisionsPerFrame, m_collisionArrayPinnedHandle.AddrOfPinnedObject(),
260 m_maxUpdatesPerFrame, m_updateArrayPinnedHandle.AddrOfPinnedObject()); 260 m_maxUpdatesPerFrame, m_updateArrayPinnedHandle.AddrOfPinnedObject(),
261 m_DebugLogCallbackHandle);
261 262
262 // Initialization to support the transition to a new API which puts most of the logic 263 // Initialization to support the transition to a new API which puts most of the logic
263 // into the C# code so it is easier to modify and add to. 264 // into the C# code so it is easier to modify and add to.
@@ -265,8 +266,6 @@ public class BSScene : PhysicsScene, IPhysicsParameters
265 266
266 Constraints = new BSConstraintCollection(World); 267 Constraints = new BSConstraintCollection(World);
267 268
268 // Note: choose one of the two following lines
269 // BulletSimAPI.CreateInitialGroundPlaneAndTerrain(WorldID);
270 TerrainManager = new BSTerrainManager(this); 269 TerrainManager = new BSTerrainManager(this);
271 TerrainManager.CreateInitialGroundPlaneAndTerrain(); 270 TerrainManager.CreateInitialGroundPlaneAndTerrain();
272 271
@@ -378,7 +377,9 @@ public class BSScene : PhysicsScene, IPhysicsParameters
378 BSCharacter actor = new BSCharacter(localID, avName, this, position, size, isFlying); 377 BSCharacter actor = new BSCharacter(localID, avName, this, position, size, isFlying);
379 lock (PhysObjects) PhysObjects.Add(localID, actor); 378 lock (PhysObjects) PhysObjects.Add(localID, actor);
380 379
381 // Remove kludge someday 380 // TODO: Remove kludge someday.
381 // We must generate a collision for avatars whether they collide or not.
382 // This is required by OpenSim to update avatar animations, etc.
382 lock (m_avatarsWithCollisions) m_avatarsWithCollisions.Add(actor); 383 lock (m_avatarsWithCollisions) m_avatarsWithCollisions.Add(actor);
383 384
384 return actor; 385 return actor;