aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorRobert Adams2015-08-24 06:39:06 -0700
committerRobert Adams2015-08-24 06:39:06 -0700
commit9a490ad2b979552c04ef0bf0d881e8b9643bebba (patch)
tree13114282d6c7a84734802621e58f76b99355e949
parentBulletSim: delay adding a scene presence to the list of presences (diff)
downloadopensim-SC_OLD-9a490ad2b979552c04ef0bf0d881e8b9643bebba.zip
opensim-SC_OLD-9a490ad2b979552c04ef0bf0d881e8b9643bebba.tar.gz
opensim-SC_OLD-9a490ad2b979552c04ef0bf0d881e8b9643bebba.tar.bz2
opensim-SC_OLD-9a490ad2b979552c04ef0bf0d881e8b9643bebba.tar.xz
Revert "BulletSim: delay adding a scene presence to the list of presences"
Remove these changes until the region crossing problems can be figured out. This reverts commit 062ec0efbda0e4ca6df5541039569e023d0d0e79.
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs13
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs12
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSScene.cs27
3 files changed, 19 insertions, 33 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
index cfcccac..9c3f160 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
@@ -75,10 +75,9 @@ public sealed class BSCharacter : BSPhysObject
75 // Avatars are always complete (in the physics engine sense) 75 // Avatars are always complete (in the physics engine sense)
76 public override bool IsIncomplete { get { return false; } } 76 public override bool IsIncomplete { get { return false; } }
77 77
78 // 'activate' is called with this character after all initialization is complete
79 public BSCharacter( 78 public BSCharacter(
80 uint localID, String avName, BSScene parent_scene, 79 uint localID, String avName, BSScene parent_scene, OMV.Vector3 pos, OMV.Vector3 vel, OMV.Vector3 size, bool isFlying)
81 OMV.Vector3 pos, OMV.Vector3 vel, OMV.Vector3 size, bool isFlying, Action<BSCharacter> activate) 80
82 : base(parent_scene, localID, avName, "BSCharacter") 81 : base(parent_scene, localID, avName, "BSCharacter")
83 { 82 {
84 _physicsActorType = (int)ActorTypes.Agent; 83 _physicsActorType = (int)ActorTypes.Agent;
@@ -125,9 +124,6 @@ public sealed class BSCharacter : BSPhysObject
125 SetPhysicalProperties(); 124 SetPhysicalProperties();
126 125
127 IsInitialized = true; 126 IsInitialized = true;
128
129 if (activate != null)
130 activate(this);
131 }); 127 });
132 return; 128 return;
133 } 129 }
@@ -476,13 +472,12 @@ public sealed class BSCharacter : BSPhysObject
476 } 472 }
477 } 473 }
478 474
479 // Force the setting of velocity. Called at taint time.
480 // Exists so that setting force by anyone can be overridden by a subcless.
481 public override OMV.Vector3 ForceVelocity { 475 public override OMV.Vector3 ForceVelocity {
482 get { return RawVelocity; } 476 get { return RawVelocity; }
483 set { 477 set {
484 PhysScene.AssertInTaintTime("BSCharacter.ForceVelocity"); 478 PhysScene.AssertInTaintTime("BSCharacter.ForceVelocity");
485 DetailLog("{0},BSCharacter.setForceVelocity,call,vel={1}", LocalID, value); 479// Util.PrintCallStack();
480 DetailLog("{0}: set ForceVelocity = {1}", LocalID, value);
486 481
487 RawVelocity = value; 482 RawVelocity = value;
488 PhysScene.PE.SetLinearVelocity(PhysBody, RawVelocity); 483 PhysScene.PE.SetLinearVelocity(PhysBody, RawVelocity);
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs
index 4669d91..90da7a6 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs
@@ -72,11 +72,6 @@ public abstract class BSPhysObject : PhysicsActor
72 } 72 }
73 protected BSPhysObject(BSScene parentScene, uint localID, string name, string typeName) 73 protected BSPhysObject(BSScene parentScene, uint localID, string name, string typeName)
74 { 74 {
75 InitializePhysObject(parentScene, localID, name, typeName);
76 }
77
78 protected void InitializePhysObject(BSScene parentScene, uint localID, string name, string typeName)
79 {
80 IsInitialized = false; 75 IsInitialized = false;
81 76
82 PhysScene = parentScene; 77 PhysScene = parentScene;
@@ -124,8 +119,6 @@ public abstract class BSPhysObject : PhysicsActor
124 // Tell the object to clean up. 119 // Tell the object to clean up.
125 public virtual void Destroy() 120 public virtual void Destroy()
126 { 121 {
127 SubscribedEventsMs = 0;
128
129 PhysicalActors.Enable(false); 122 PhysicalActors.Enable(false);
130 PhysScene.TaintedObject(LocalID, "BSPhysObject.Destroy", delegate() 123 PhysScene.TaintedObject(LocalID, "BSPhysObject.Destroy", delegate()
131 { 124 {
@@ -462,7 +455,6 @@ public abstract class BSPhysObject : PhysicsActor
462 // Return 'true' if a collision was processed and should be sent up. 455 // Return 'true' if a collision was processed and should be sent up.
463 // Return 'false' if this object is not enabled/subscribed/appropriate for or has already seen this collision. 456 // Return 'false' if this object is not enabled/subscribed/appropriate for or has already seen this collision.
464 // Called at taint time from within the Step() function 457 // Called at taint time from within the Step() function
465 // Both 'CollisionLock' and 'PhysObjects' are locked when this is called by 'SendCollisions'.
466 public delegate bool CollideCall(uint collidingWith, BSPhysObject collidee, OMV.Vector3 contactPoint, OMV.Vector3 contactNormal, float pentrationDepth); 458 public delegate bool CollideCall(uint collidingWith, BSPhysObject collidee, OMV.Vector3 contactPoint, OMV.Vector3 contactNormal, float pentrationDepth);
467 public virtual bool Collide(uint collidingWith, BSPhysObject collidee, 459 public virtual bool Collide(uint collidingWith, BSPhysObject collidee,
468 OMV.Vector3 contactPoint, OMV.Vector3 contactNormal, float pentrationDepth) 460 OMV.Vector3 contactPoint, OMV.Vector3 contactNormal, float pentrationDepth)
@@ -520,7 +512,7 @@ public abstract class BSPhysObject : PhysicsActor
520 512
521 // If no collisions this call but there were collisions last call, force the collision 513 // If no collisions this call but there were collisions last call, force the collision
522 // event to be happen right now so quick collision_end. 514 // event to be happen right now so quick collision_end.
523 bool force = (CollisionCollection.Count == 0 && CollisionsLastReported.Count != 0); 515 bool force = (CollisionCollection.Count == 0 && CollisionsLastReported.Count != 0);
524 516
525 // throttle the collisions to the number of milliseconds specified in the subscription 517 // throttle the collisions to the number of milliseconds specified in the subscription
526 if (force || (PhysScene.SimulationNowTime >= NextCollisionOkTime)) 518 if (force || (PhysScene.SimulationNowTime >= NextCollisionOkTime))
@@ -553,7 +545,7 @@ public abstract class BSPhysObject : PhysicsActor
553 // Subscribe for collision events. 545 // Subscribe for collision events.
554 // Parameter is the millisecond rate the caller wishes collision events to occur. 546 // Parameter is the millisecond rate the caller wishes collision events to occur.
555 public override void SubscribeEvents(int ms) { 547 public override void SubscribeEvents(int ms) {
556 DetailLog("{0},{1}.SubscribeEvents,subscribing,ms={2}", LocalID, TypeName, ms); 548 // DetailLog("{0},{1}.SubscribeEvents,subscribing,ms={2}", LocalID, TypeName, ms);
557 SubscribedEventsMs = ms; 549 SubscribedEventsMs = ms;
558 if (ms > 0) 550 if (ms > 0)
559 { 551 {
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
index 2a8a6a5..8a19944 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
@@ -477,19 +477,16 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
477 477
478 if (!m_initialized) return null; 478 if (!m_initialized) return null;
479 479
480 BSCharacter actor = new BSCharacter(localID, avName, this, position, velocity, size, isFlying, 480 BSCharacter actor = new BSCharacter(localID, avName, this, position, velocity, size, isFlying);
481 (aa) => 481 lock (PhysObjects)
482 { 482 PhysObjects.Add(localID, actor);
483 // While the actor exists, don't add it to the active avatar lists until completely initialized 483
484 lock (PhysObjects) 484 // TODO: Remove kludge someday.
485 PhysObjects.Add(localID, aa); 485 // We must generate a collision for avatars whether they collide or not.
486 // This is required by OpenSim to update avatar animations, etc.
487 lock (AvatarsInSceneLock)
488 AvatarsInScene.Add(actor);
486 489
487 // TODO: Remove kludge someday.
488 // We must generate a collision for avatars whether they collide or not.
489 // This is required by OpenSim to update avatar animations, etc.
490 lock (AvatarsInSceneLock)
491 AvatarsInScene.Add(aa);
492 });
493 return actor; 490 return actor;
494 } 491 }
495 492
@@ -833,8 +830,10 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
833 if (collider.Collide(collidingWith, collidee, collidePoint, collideNormal, penetration)) 830 if (collider.Collide(collidingWith, collidee, collidePoint, collideNormal, penetration))
834 { 831 {
835 // If a collision was 'good', remember to send it to the simulator 832 // If a collision was 'good', remember to send it to the simulator
836 // Note that 'CollisionLock' was locked before the call to 'SendCollsions' 833 lock (CollisionLock)
837 ObjectsWithCollisions.Add(collider); 834 {
835 ObjectsWithCollisions.Add(collider);
836 }
838 } 837 }
839 } 838 }
840 839