diff options
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 | { |