aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
diff options
context:
space:
mode:
authorRobert Adams2012-09-13 13:51:42 -0700
committerRobert Adams2012-09-15 15:31:54 -0700
commit6632eb7c051e2638ea1c58c2876e7d6825398556 (patch)
tree15e19cbd50e4ab1934d7ae2290784cf54488641f /OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
parentBulletSim: set all linkset objects center of mass to the whole linkset's cent... (diff)
downloadopensim-SC-6632eb7c051e2638ea1c58c2876e7d6825398556.zip
opensim-SC-6632eb7c051e2638ea1c58c2876e7d6825398556.tar.gz
opensim-SC-6632eb7c051e2638ea1c58c2876e7d6825398556.tar.bz2
opensim-SC-6632eb7c051e2638ea1c58c2876e7d6825398556.tar.xz
BulletSim: Remove calculation and passing of unused collied object type.
Fix collision code to properly sense mega-region children regions as terrain. When setting an object physical, reset all the physical properties (friction, ...).
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSScene.cs')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSScene.cs26
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);