diff options
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSActorAvatarMove.cs')
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSActorAvatarMove.cs | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSActorAvatarMove.cs b/OpenSim/Region/Physics/BulletSPlugin/BSActorAvatarMove.cs index 42381ef..14518e9 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSActorAvatarMove.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSActorAvatarMove.cs | |||
@@ -205,6 +205,17 @@ public class BSActorAvatarMove : BSActor | |||
205 | // Flying and not colliding and velocity nearly zero. | 205 | // Flying and not colliding and velocity nearly zero. |
206 | m_controllingPrim.ZeroMotion(true /* inTaintTime */); | 206 | m_controllingPrim.ZeroMotion(true /* inTaintTime */); |
207 | } | 207 | } |
208 | else | ||
209 | { | ||
210 | //We are falling but are not touching any keys make sure not falling too fast | ||
211 | if (m_controllingPrim.RawVelocity.Z < BSParam.AvatarTerminalVelocity) | ||
212 | { | ||
213 | |||
214 | OMV.Vector3 slowingForce = new OMV.Vector3(0f, 0f, BSParam.AvatarTerminalVelocity - m_controllingPrim.RawVelocity.Z) * m_controllingPrim.Mass; | ||
215 | m_physicsScene.PE.ApplyCentralImpulse(m_controllingPrim.PhysBody, slowingForce); | ||
216 | } | ||
217 | |||
218 | } | ||
208 | } | 219 | } |
209 | 220 | ||
210 | m_physicsScene.DetailLog("{0},BSCharacter.MoveMotor,taint,stopping,target={1},colliding={2}", | 221 | m_physicsScene.DetailLog("{0},BSCharacter.MoveMotor,taint,stopping,target={1},colliding={2}", |
@@ -252,8 +263,17 @@ public class BSActorAvatarMove : BSActor | |||
252 | } | 263 | } |
253 | else | 264 | else |
254 | { | 265 | { |
255 | // Since we're not affected by anything, whatever vertical motion the avatar has, continue that. | 266 | |
256 | stepVelocity.Z = m_controllingPrim.RawVelocity.Z; | 267 | // Since we're not affected by anything, the avatar must be falling and we do not want that to be too fast. |
268 | if (m_controllingPrim.RawVelocity.Z < BSParam.AvatarTerminalVelocity) | ||
269 | { | ||
270 | |||
271 | stepVelocity.Z = BSParam.AvatarTerminalVelocity; | ||
272 | } | ||
273 | else | ||
274 | { | ||
275 | stepVelocity.Z = m_controllingPrim.RawVelocity.Z; | ||
276 | } | ||
257 | } | 277 | } |
258 | // DetailLog("{0},BSCharacter.MoveMotor,taint,overrideStepZWithWorldZ,stepVel={1}", LocalID, stepVelocity); | 278 | // DetailLog("{0},BSCharacter.MoveMotor,taint,overrideStepZWithWorldZ,stepVel={1}", LocalID, stepVelocity); |
259 | } | 279 | } |