aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/PhysicsModules/BulletS
diff options
context:
space:
mode:
authorRobert Adams2016-01-19 22:09:51 -0800
committerRobert Adams2016-01-19 22:09:51 -0800
commit33af41905021e6ab2e51873a75b585044e445974 (patch)
tree6c3e49224c90867c590cdfb93b3f2240c76ca717 /OpenSim/Region/PhysicsModules/BulletS
parentBulletSim: add stationary suppression on AddForce application. This enables (diff)
downloadopensim-SC_OLD-33af41905021e6ab2e51873a75b585044e445974.zip
opensim-SC_OLD-33af41905021e6ab2e51873a75b585044e445974.tar.gz
opensim-SC_OLD-33af41905021e6ab2e51873a75b585044e445974.tar.bz2
opensim-SC_OLD-33af41905021e6ab2e51873a75b585044e445974.tar.xz
BulletSim: make collision sounds work most of the time. Seems that collisions
usually stop the collider so velocity is often small. Also remove some chatty debug messages.
Diffstat (limited to 'OpenSim/Region/PhysicsModules/BulletS')
-rwxr-xr-xOpenSim/Region/PhysicsModules/BulletS/BSActorAvatarMove.cs2
-rw-r--r--OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs1
-rwxr-xr-xOpenSim/Region/PhysicsModules/BulletS/BSPhysObject.cs11
3 files changed, 9 insertions, 5 deletions
diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSActorAvatarMove.cs b/OpenSim/Region/PhysicsModules/BulletS/BSActorAvatarMove.cs
index 35823ae..79ee00f 100755
--- a/OpenSim/Region/PhysicsModules/BulletS/BSActorAvatarMove.cs
+++ b/OpenSim/Region/PhysicsModules/BulletS/BSActorAvatarMove.cs
@@ -140,7 +140,7 @@ public class BSActorAvatarMove : BSActor
140 1f // efficiency 140 1f // efficiency
141 ); 141 );
142 m_velocityMotor.ErrorZeroThreshold = BSParam.AvatarStopZeroThreshold; 142 m_velocityMotor.ErrorZeroThreshold = BSParam.AvatarStopZeroThreshold;
143 m_velocityMotor.PhysicsScene = m_controllingPrim.PhysScene; // DEBUG DEBUG so motor will output detail log messages. 143 // m_velocityMotor.PhysicsScene = m_controllingPrim.PhysScene; // DEBUG DEBUG so motor will output detail log messages.
144 SetVelocityAndTarget(m_controllingPrim.RawVelocity, m_controllingPrim.TargetVelocity, true /* inTaintTime */); 144 SetVelocityAndTarget(m_controllingPrim.RawVelocity, m_controllingPrim.TargetVelocity, true /* inTaintTime */);
145 145
146 m_physicsScene.BeforeStep += Mover; 146 m_physicsScene.BeforeStep += Mover;
diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs b/OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs
index 4b75e32..6d5589f 100644
--- a/OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs
+++ b/OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs
@@ -89,6 +89,7 @@ public sealed class BSCharacter : BSPhysObject
89 _buoyancy = ComputeBuoyancyFromFlying(isFlying); 89 _buoyancy = ComputeBuoyancyFromFlying(isFlying);
90 Friction = BSParam.AvatarStandingFriction; 90 Friction = BSParam.AvatarStandingFriction;
91 Density = BSParam.AvatarDensity; 91 Density = BSParam.AvatarDensity;
92 _isPhysical = true;
92 93
93 // Old versions of ScenePresence passed only the height. If width and/or depth are zero, 94 // Old versions of ScenePresence passed only the height. If width and/or depth are zero,
94 // replace with the default values. 95 // replace with the default values.
diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSPhysObject.cs b/OpenSim/Region/PhysicsModules/BulletS/BSPhysObject.cs
index ff6baca..a70d1b8 100755
--- a/OpenSim/Region/PhysicsModules/BulletS/BSPhysObject.cs
+++ b/OpenSim/Region/PhysicsModules/BulletS/BSPhysObject.cs
@@ -505,17 +505,20 @@ public abstract class BSPhysObject : PhysicsActor
505 // Collision sound requires a velocity to know it should happen. This is a lot of computation for a little used feature. 505 // Collision sound requires a velocity to know it should happen. This is a lot of computation for a little used feature.
506 OMV.Vector3 relvel = OMV.Vector3.Zero; 506 OMV.Vector3 relvel = OMV.Vector3.Zero;
507 if (IsPhysical) 507 if (IsPhysical)
508 relvel = Velocity; 508 relvel = RawVelocity;
509 if (collidee != null && collidee.IsPhysical) 509 if (collidee != null && collidee.IsPhysical)
510 relvel -= collidee.Velocity; 510 relvel -= collidee.RawVelocity;
511 newContact.RelativeSpeed = OMV.Vector3.Dot(relvel, contactNormal); 511 newContact.RelativeSpeed = OMV.Vector3.Dot(relvel, contactNormal);
512 // DetailLog("{0},{1}.Collision.AddCollider,vel={2},contee.vel={3},relvel={4},relspeed={5}",
513 // LocalID, TypeName, RawVelocity, (collidee == null ? OMV.Vector3.Zero : collidee.RawVelocity), relvel, newContact.RelativeSpeed);
512 514
513 lock (PhysScene.CollisionLock) 515 lock (PhysScene.CollisionLock)
514 { 516 {
515 CollisionCollection.AddCollider(collideeLocalID, newContact); 517 CollisionCollection.AddCollider(collideeLocalID, newContact);
516 } 518 }
517 DetailLog("{0},{1}.Collision.AddCollider,call,with={2},point={3},normal={4},depth={5},colliderMoving={6}", 519 DetailLog("{0},{1}.Collision.AddCollider,call,with={2},point={3},normal={4},depth={5},speed={6},colliderMoving={7}",
518 LocalID, TypeName, collideeLocalID, contactPoint, contactNormal, pentrationDepth, ColliderIsMoving); 520 LocalID, TypeName, collideeLocalID, contactPoint, contactNormal, pentrationDepth,
521 newContact.RelativeSpeed, ColliderIsMoving);
519 522
520 ret = true; 523 ret = true;
521 } 524 }