diff options
author | Robert Adams | 2013-02-08 15:25:57 -0800 |
---|---|---|
committer | Robert Adams | 2013-02-08 16:29:40 -0800 |
commit | 1b55a9d81e66972312fdc801d17da697466f9ed4 (patch) | |
tree | 32c478526da580deb85a5a1218434e8e21173cd1 /OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs | |
parent | BulletSim: add initial instance of the ExtendedPhysics region module which ad... (diff) | |
download | opensim-SC-1b55a9d81e66972312fdc801d17da697466f9ed4.zip opensim-SC-1b55a9d81e66972312fdc801d17da697466f9ed4.tar.gz opensim-SC-1b55a9d81e66972312fdc801d17da697466f9ed4.tar.bz2 opensim-SC-1b55a9d81e66972312fdc801d17da697466f9ed4.tar.xz |
BulletSim: fix avatar bobbing or jiggling while stationary flying.
Various comments and debugging message mods.
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs')
-rw-r--r-- | OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs | 29 |
1 files changed, 16 insertions, 13 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs index 0afc437..6a995a2 100644 --- a/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSCharacter.cs | |||
@@ -140,7 +140,7 @@ public sealed class BSCharacter : BSPhysObject | |||
140 | ZeroMotion(true); | 140 | ZeroMotion(true); |
141 | ForcePosition = _position; | 141 | ForcePosition = _position; |
142 | 142 | ||
143 | // Set the velocity and compute the proper friction | 143 | // Set the velocity |
144 | _velocityMotor.Reset(); | 144 | _velocityMotor.Reset(); |
145 | _velocityMotor.SetTarget(_velocity); | 145 | _velocityMotor.SetTarget(_velocity); |
146 | _velocityMotor.SetCurrent(_velocity); | 146 | _velocityMotor.SetCurrent(_velocity); |
@@ -214,25 +214,28 @@ public sealed class BSCharacter : BSPhysObject | |||
214 | _velocityMotor.Step(timeStep); | 214 | _velocityMotor.Step(timeStep); |
215 | 215 | ||
216 | // If we're not supposed to be moving, make sure things are zero. | 216 | // If we're not supposed to be moving, make sure things are zero. |
217 | if (_velocityMotor.ErrorIsZero() && _velocityMotor.TargetValue == OMV.Vector3.Zero && IsColliding) | 217 | if (_velocityMotor.ErrorIsZero() && _velocityMotor.TargetValue == OMV.Vector3.Zero) |
218 | { | 218 | { |
219 | // The avatar shouldn't be moving | 219 | // The avatar shouldn't be moving |
220 | _velocityMotor.Zero(); | 220 | _velocityMotor.Zero(); |
221 | 221 | ||
222 | // If we are colliding with a stationary object, presume we're standing and don't move around | 222 | if (IsColliding) |
223 | if (!ColliderIsMoving) | ||
224 | { | 223 | { |
225 | DetailLog("{0},BSCharacter.MoveMotor,collidingWithStationary,zeroingMotion", LocalID); | 224 | // If we are colliding with a stationary object, presume we're standing and don't move around |
226 | ZeroMotion(true /* inTaintTime */); | 225 | if (!ColliderIsMoving) |
227 | } | 226 | { |
227 | DetailLog("{0},BSCharacter.MoveMotor,collidingWithStationary,zeroingMotion", LocalID); | ||
228 | ZeroMotion(true /* inTaintTime */); | ||
229 | } | ||
228 | 230 | ||
229 | // Standing has more friction on the ground | 231 | // Standing has more friction on the ground |
230 | if (_currentFriction != BSParam.AvatarStandingFriction) | 232 | if (_currentFriction != BSParam.AvatarStandingFriction) |
231 | { | 233 | { |
232 | _currentFriction = BSParam.AvatarStandingFriction; | 234 | _currentFriction = BSParam.AvatarStandingFriction; |
233 | PhysicsScene.PE.SetFriction(PhysBody, _currentFriction); | 235 | PhysicsScene.PE.SetFriction(PhysBody, _currentFriction); |
236 | } | ||
234 | } | 237 | } |
235 | DetailLog("{0},BSCharacter.MoveMotor,taint,stopping,target={1}", LocalID, _velocityMotor.TargetValue); | 238 | DetailLog("{0},BSCharacter.MoveMotor,taint,stopping,target={1},colliding={2}", LocalID, _velocityMotor.TargetValue, IsColliding); |
236 | } | 239 | } |
237 | else | 240 | else |
238 | { | 241 | { |