aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics
diff options
context:
space:
mode:
authorRobert Adams2013-08-08 13:53:12 -0700
committerRobert Adams2013-08-08 13:55:17 -0700
commit6410a25cefcb1e7f87b76f273f8c6569fbe17670 (patch)
tree29dbaa0d610d8eb7c79ac3871ece5119d53a9f2c /OpenSim/Region/Physics
parentMake m_originRegionID in ScenePresence public to allow DSG module to work for... (diff)
downloadopensim-SC_OLD-6410a25cefcb1e7f87b76f273f8c6569fbe17670.zip
opensim-SC_OLD-6410a25cefcb1e7f87b76f273f8c6569fbe17670.tar.gz
opensim-SC_OLD-6410a25cefcb1e7f87b76f273f8c6569fbe17670.tar.bz2
opensim-SC_OLD-6410a25cefcb1e7f87b76f273f8c6569fbe17670.tar.xz
BulletSim: adjust avatar position when the avatar's size is changed.
This fixes the problem of avatars bouncing when logged in. Added a little height to the avatar height fudges to eliminate a problem of feet being in the ground a bit.
Diffstat (limited to 'OpenSim/Region/Physics')
-rw-r--r--OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs12
-rwxr-xr-xOpenSim/Region/Physics/BulletSPlugin/BSParam.cs4
2 files changed, 12 insertions, 4 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
index 58a417e..9af3dce 100644
--- a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs
@@ -96,8 +96,8 @@ public sealed class BSCharacter : BSPhysObject
96 m_moveActor = new BSActorAvatarMove(PhysScene, this, AvatarMoveActorName); 96 m_moveActor = new BSActorAvatarMove(PhysScene, this, AvatarMoveActorName);
97 PhysicalActors.Add(AvatarMoveActorName, m_moveActor); 97 PhysicalActors.Add(AvatarMoveActorName, m_moveActor);
98 98
99 DetailLog("{0},BSCharacter.create,call,size={1},scale={2},density={3},volume={4},mass={5}", 99 DetailLog("{0},BSCharacter.create,call,size={1},scale={2},density={3},volume={4},mass={5},pos={6}",
100 LocalID, _size, Scale, Density, _avatarVolume, RawMass); 100 LocalID, _size, Scale, Density, _avatarVolume, RawMass, pos);
101 101
102 // do actual creation in taint time 102 // do actual creation in taint time
103 PhysScene.TaintedObject("BSCharacter.create", delegate() 103 PhysScene.TaintedObject("BSCharacter.create", delegate()
@@ -190,6 +190,10 @@ public sealed class BSCharacter : BSPhysObject
190 } 190 }
191 191
192 set { 192 set {
193 // This is how much the avatar size is changing. Positive means getting bigger.
194 // The avatar altitude must be adjusted for this change.
195 float heightChange = value.Z - _size.Z;
196
193 _size = value; 197 _size = value;
194 // Old versions of ScenePresence passed only the height. If width and/or depth are zero, 198 // Old versions of ScenePresence passed only the height. If width and/or depth are zero,
195 // replace with the default values. 199 // replace with the default values.
@@ -207,6 +211,10 @@ public sealed class BSCharacter : BSPhysObject
207 { 211 {
208 PhysScene.PE.SetLocalScaling(PhysShape.physShapeInfo, Scale); 212 PhysScene.PE.SetLocalScaling(PhysShape.physShapeInfo, Scale);
209 UpdatePhysicalMassProperties(RawMass, true); 213 UpdatePhysicalMassProperties(RawMass, true);
214
215 // Adjust the avatar's position to account for the increase/decrease in size
216 ForcePosition = new OMV.Vector3(RawPosition.X, RawPosition.Y, RawPosition.Z + heightChange / 2f);
217
210 // Make sure this change appears as a property update event 218 // Make sure this change appears as a property update event
211 PhysScene.PE.PushUpdate(PhysBody); 219 PhysScene.PE.PushUpdate(PhysBody);
212 } 220 }
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs
index 4520171..fcb892a 100755
--- a/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs
+++ b/OpenSim/Region/Physics/BulletSPlugin/BSParam.cs
@@ -570,9 +570,9 @@ public static class BSParam
570 new ParameterDefn<float>("AvatarHeightLowFudge", "A fudge factor to make small avatars stand on the ground", 570 new ParameterDefn<float>("AvatarHeightLowFudge", "A fudge factor to make small avatars stand on the ground",
571 -0.2f ), 571 -0.2f ),
572 new ParameterDefn<float>("AvatarHeightMidFudge", "A fudge distance to adjust average sized avatars to be standing on ground", 572 new ParameterDefn<float>("AvatarHeightMidFudge", "A fudge distance to adjust average sized avatars to be standing on ground",
573 0.1f ), 573 0.2f ),
574 new ParameterDefn<float>("AvatarHeightHighFudge", "A fudge factor to make tall avatars stand on the ground", 574 new ParameterDefn<float>("AvatarHeightHighFudge", "A fudge factor to make tall avatars stand on the ground",
575 0.1f ), 575 0.2f ),
576 new ParameterDefn<float>("AvatarContactProcessingThreshold", "Distance from capsule to check for collisions", 576 new ParameterDefn<float>("AvatarContactProcessingThreshold", "Distance from capsule to check for collisions",
577 0.1f ), 577 0.1f ),
578 new ParameterDefn<float>("AvatarBelowGroundUpCorrectionMeters", "Meters to move avatar up if it seems to be below ground", 578 new ParameterDefn<float>("AvatarBelowGroundUpCorrectionMeters", "Meters to move avatar up if it seems to be below ground",