diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs index 7017194..e0b4992 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | |||
@@ -167,11 +167,16 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
167 | public bool VehiclePhysicalLoggingEnabled { get; private set; } | 167 | public bool VehiclePhysicalLoggingEnabled { get; private set; } |
168 | 168 | ||
169 | #region Construction and Initialization | 169 | #region Construction and Initialization |
170 | public BSScene(string identifier) | 170 | public BSScene(string engineType, string identifier) |
171 | { | 171 | { |
172 | m_initialized = false; | 172 | m_initialized = false; |
173 | // we are passed the name of the region we're working for. | 173 | |
174 | // The name of the region we're working for is passed to us. Keep for identification. | ||
174 | RegionName = identifier; | 175 | RegionName = identifier; |
176 | |||
177 | // Set identifying variables in the PhysicsScene interface. | ||
178 | EngineType = engineType; | ||
179 | Name = EngineType + "/" + RegionName; | ||
175 | } | 180 | } |
176 | 181 | ||
177 | public override void Initialise(IMesher meshmerizer, IConfigSource config) | 182 | public override void Initialise(IMesher meshmerizer, IConfigSource config) |
@@ -382,12 +387,14 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
382 | if (!m_initialized) return null; | 387 | if (!m_initialized) return null; |
383 | 388 | ||
384 | BSCharacter actor = new BSCharacter(localID, avName, this, position, size, isFlying); | 389 | BSCharacter actor = new BSCharacter(localID, avName, this, position, size, isFlying); |
385 | lock (PhysObjects) PhysObjects.Add(localID, actor); | 390 | lock (PhysObjects) |
391 | PhysObjects.Add(localID, actor); | ||
386 | 392 | ||
387 | // TODO: Remove kludge someday. | 393 | // TODO: Remove kludge someday. |
388 | // We must generate a collision for avatars whether they collide or not. | 394 | // We must generate a collision for avatars whether they collide or not. |
389 | // This is required by OpenSim to update avatar animations, etc. | 395 | // This is required by OpenSim to update avatar animations, etc. |
390 | lock (m_avatars) m_avatars.Add(actor); | 396 | lock (m_avatars) |
397 | m_avatars.Add(actor); | ||
391 | 398 | ||
392 | return actor; | 399 | return actor; |
393 | } | 400 | } |
@@ -403,9 +410,11 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
403 | { | 410 | { |
404 | try | 411 | try |
405 | { | 412 | { |
406 | lock (PhysObjects) PhysObjects.Remove(actor.LocalID); | 413 | lock (PhysObjects) |
414 | PhysObjects.Remove(bsactor.LocalID); | ||
407 | // Remove kludge someday | 415 | // Remove kludge someday |
408 | lock (m_avatars) m_avatars.Remove(bsactor); | 416 | lock (m_avatars) |
417 | m_avatars.Remove(bsactor); | ||
409 | } | 418 | } |
410 | catch (Exception e) | 419 | catch (Exception e) |
411 | { | 420 | { |
@@ -414,6 +423,11 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
414 | bsactor.Destroy(); | 423 | bsactor.Destroy(); |
415 | // bsactor.dispose(); | 424 | // bsactor.dispose(); |
416 | } | 425 | } |
426 | else | ||
427 | { | ||
428 | m_log.ErrorFormat("{0}: Requested to remove avatar that is not a BSCharacter. ID={1}, type={2}", | ||
429 | LogHeader, actor.LocalID, actor.GetType().Name); | ||
430 | } | ||
417 | } | 431 | } |
418 | 432 | ||
419 | public override void RemovePrim(PhysicsActor prim) | 433 | public override void RemovePrim(PhysicsActor prim) |
@@ -486,6 +500,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters | |||
486 | ProcessTaints(); | 500 | ProcessTaints(); |
487 | 501 | ||
488 | // Some of the physical objects requre individual, pre-step calls | 502 | // Some of the physical objects requre individual, pre-step calls |
503 | // (vehicles and avatar movement, in particular) | ||
489 | TriggerPreStepEvent(timeStep); | 504 | TriggerPreStepEvent(timeStep); |
490 | 505 | ||
491 | // the prestep actions might have added taints | 506 | // the prestep actions might have added taints |