aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorRobert Adams2012-11-20 08:34:18 -0800
committerRobert Adams2012-11-21 16:42:34 -0800
commit2f5fe4b88e8eb0388cc2138c48a941b1317ed560 (patch)
tree47040fe6c84d9584306c7807a8a98217acfb9045 /OpenSim
parentIf GetAgents() is called with an empty userIDs array then don't bother with a... (diff)
downloadopensim-SC_OLD-2f5fe4b88e8eb0388cc2138c48a941b1317ed560.zip
opensim-SC_OLD-2f5fe4b88e8eb0388cc2138c48a941b1317ed560.tar.gz
opensim-SC_OLD-2f5fe4b88e8eb0388cc2138c48a941b1317ed560.tar.bz2
opensim-SC_OLD-2f5fe4b88e8eb0388cc2138c48a941b1317ed560.tar.xz
BulletSim: tweek avatar capsule parameters so avatar feet don't go below ground. This solves the bouncing, short avatar problem (Mantis 6403).
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs7
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSScene.cs11
2 files changed, 10 insertions, 8 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
index 3c48dcc..fa1a23f 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
@@ -184,8 +184,8 @@ public sealed class BSCharacter : BSPhysObject
184 _size = value; 184 _size = value;
185 ComputeAvatarScale(_size); 185 ComputeAvatarScale(_size);
186 ComputeAvatarVolumeAndMass(); 186 ComputeAvatarVolumeAndMass();
187 DetailLog("{0},BSCharacter.setSize,call,scale={1},density={2},volume={3},mass={4}", 187 DetailLog("{0},BSCharacter.setSize,call,size={1},scale={2},density={3},volume={4},mass={5}",
188 LocalID, Scale, _avatarDensity, _avatarVolume, RawMass); 188 LocalID, _size, Scale, _avatarDensity, _avatarVolume, RawMass);
189 189
190 PhysicsScene.TaintedObject("BSCharacter.setSize", delegate() 190 PhysicsScene.TaintedObject("BSCharacter.setSize", delegate()
191 { 191 {
@@ -619,7 +619,8 @@ public sealed class BSCharacter : BSPhysObject
619 newScale.Y = PhysicsScene.Params.avatarCapsuleRadius; 619 newScale.Y = PhysicsScene.Params.avatarCapsuleRadius;
620 620
621 // From the total height, remove the capsule half spheres that are at each end 621 // From the total height, remove the capsule half spheres that are at each end
622 newScale.Z = size.Z - (newScale.X + newScale.Y); 622 // The 1.15f came from ODE. Not sure what this factors in.
623 newScale.Z = (size.Z * 1.15f) - (newScale.X + newScale.Y);
623 Scale = newScale; 624 Scale = newScale;
624 } 625 }
625 626
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
index 2fee95e..58dccea 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSScene.cs
@@ -712,7 +712,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
712 // here just before the physics engine is called to step the simulation. 712 // here just before the physics engine is called to step the simulation.
713 public void ProcessTaints() 713 public void ProcessTaints()
714 { 714 {
715 InTaintTime = true; 715 InTaintTime = true; // Only used for debugging so locking is not necessary.
716 ProcessRegularTaints(); 716 ProcessRegularTaints();
717 ProcessPostTaintTaints(); 717 ProcessPostTaintTaints();
718 InTaintTime = false; 718 InTaintTime = false;
@@ -758,6 +758,7 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
758 DetailLog("{0},BSScene.ProcessTaints,leftTaintsOnList,numNotProcessed={1}", DetailLogZero, _taintOperations.Count); 758 DetailLog("{0},BSScene.ProcessTaints,leftTaintsOnList,numNotProcessed={1}", DetailLogZero, _taintOperations.Count);
759 } 759 }
760 */ 760 */
761
761 // swizzle a new list into the list location so we can process what's there 762 // swizzle a new list into the list location so we can process what's there
762 List<TaintCallbackEntry> oldList; 763 List<TaintCallbackEntry> oldList;
763 lock (_taintLock) 764 lock (_taintLock)
@@ -787,8 +788,6 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
787 // will replace any previous operation by the same object. 788 // will replace any previous operation by the same object.
788 public void PostTaintObject(String ident, uint ID, TaintCallback callback) 789 public void PostTaintObject(String ident, uint ID, TaintCallback callback)
789 { 790 {
790 if (!m_initialized) return;
791
792 string uniqueIdent = ident + "-" + ID.ToString(); 791 string uniqueIdent = ident + "-" + ID.ToString();
793 lock (_taintLock) 792 lock (_taintLock)
794 { 793 {
@@ -864,13 +863,14 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
864 } 863 }
865 } 864 }
866 865
866 // Only used for debugging. Does not change state of anything so locking is not necessary.
867 public bool AssertInTaintTime(string whereFrom) 867 public bool AssertInTaintTime(string whereFrom)
868 { 868 {
869 if (!InTaintTime) 869 if (!InTaintTime)
870 { 870 {
871 DetailLog("{0},BSScene.AssertInTaintTime,NOT IN TAINT TIME,Region={1},Where={2}", DetailLogZero, RegionName, whereFrom); 871 DetailLog("{0},BSScene.AssertInTaintTime,NOT IN TAINT TIME,Region={1},Where={2}", DetailLogZero, RegionName, whereFrom);
872 m_log.ErrorFormat("{0} NOT IN TAINT TIME!! Region={1}, Where={2}", LogHeader, RegionName, whereFrom); 872 m_log.ErrorFormat("{0} NOT IN TAINT TIME!! Region={1}, Where={2}", LogHeader, RegionName, whereFrom);
873 Util.PrintCallStack(); 873 Util.PrintCallStack(); // Prints the stack into the DEBUG log file.
874 } 874 }
875 return InTaintTime; 875 return InTaintTime;
876 } 876 }
@@ -1186,7 +1186,8 @@ public sealed class BSScene : PhysicsScene, IPhysicsParameters
1186 (s) => { return s.m_params[0].avatarCapsuleRadius; }, 1186 (s) => { return s.m_params[0].avatarCapsuleRadius; },
1187 (s,p,l,v) => { s.UpdateParameterObject(ref s.m_params[0].avatarCapsuleRadius, p, l, v); } ), 1187 (s,p,l,v) => { s.UpdateParameterObject(ref s.m_params[0].avatarCapsuleRadius, p, l, v); } ),
1188 new ParameterDefn("AvatarCapsuleHeight", "Default height of space around avatar", 1188 new ParameterDefn("AvatarCapsuleHeight", "Default height of space around avatar",
1189 1.5f, 1189 // 1.5f,
1190 2.140599f,
1190 (s,cf,p,v) => { s.m_params[0].avatarCapsuleHeight = cf.GetFloat(p, v); }, 1191 (s,cf,p,v) => { s.m_params[0].avatarCapsuleHeight = cf.GetFloat(p, v); },
1191 (s) => { return s.m_params[0].avatarCapsuleHeight; }, 1192 (s) => { return s.m_params[0].avatarCapsuleHeight; },
1192 (s,p,l,v) => { s.UpdateParameterObject(ref s.m_params[0].avatarCapsuleHeight, p, l, v); } ), 1193 (s,p,l,v) => { s.UpdateParameterObject(ref s.m_params[0].avatarCapsuleHeight, p, l, v); } ),