diff options
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSScene.cs')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | 26 |
1 files changed, 10 insertions, 16 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs index 9c958d5..c38867f 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs | |||
@@ -583,27 +583,21 @@ public class BSScene : PhysicsScene, IPhysicsParameters | |||
583 | return; // don't send collisions to the terrain | 583 | return; // don't send collisions to the terrain |
584 | } | 584 | } |
585 | 585 | ||
586 | BSPhysObject collider = PhysObjects[localID]; | 586 | BSPhysObject collider; |
587 | // TODO: as of this code, terrain was not in the physical object list. | 587 | if (!PhysObjects.TryGetValue(localID, out collider)) |
588 | // When BSTerrain is created and it will be in the list, we can remove | ||
589 | // the possibility that it's not there and just fetch the collidee. | ||
590 | BSPhysObject collidee = null; | ||
591 | |||
592 | ActorTypes type = ActorTypes.Prim; | ||
593 | if (collidingWith <= TerrainManager.HighestTerrainID) | ||
594 | { | 588 | { |
595 | type = ActorTypes.Ground; | 589 | // If the object that is colliding cannot be found, just ignore the collision. |
596 | } | 590 | return; |
597 | else | ||
598 | { | ||
599 | collidee = PhysObjects[collidingWith]; | ||
600 | if (collidee is BSCharacter) | ||
601 | type = ActorTypes.Agent; | ||
602 | } | 591 | } |
603 | 592 | ||
593 | // The terrain is not in the physical object list so 'collidee' | ||
594 | // can be null when Collide() is called. | ||
595 | BSPhysObject collidee = null; | ||
596 | PhysObjects.TryGetValue(collidingWith, out collidee); | ||
597 | |||
604 | // DetailLog("{0},BSScene.SendCollision,collide,id={1},with={2}", DetailLogZero, localID, collidingWith); | 598 | // DetailLog("{0},BSScene.SendCollision,collide,id={1},with={2}", DetailLogZero, localID, collidingWith); |
605 | 599 | ||
606 | if (collider.Collide(collidingWith, collidee, type, collidePoint, collideNormal, penetration)) | 600 | if (collider.Collide(collidingWith, collidee, collidePoint, collideNormal, penetration)) |
607 | { | 601 | { |
608 | // If a collision was posted, remember to send it to the simulator | 602 | // If a collision was posted, remember to send it to the simulator |
609 | m_objectsWithCollisions.Add(collider); | 603 | m_objectsWithCollisions.Add(collider); |