diff options
Diffstat (limited to 'OpenSim/Region')
-rwxr-xr-x | OpenSim/Region/PhysicsModules/BulletS/BSActorAvatarMove.cs | 24 | ||||
-rwxr-xr-x[-rw-r--r--] | OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs | 2 | ||||
-rwxr-xr-x | OpenSim/Region/PhysicsModules/BulletS/BSParam.cs | 3 |
3 files changed, 19 insertions, 10 deletions
diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSActorAvatarMove.cs b/OpenSim/Region/PhysicsModules/BulletS/BSActorAvatarMove.cs index 40c6b98..4e9216d 100755 --- a/OpenSim/Region/PhysicsModules/BulletS/BSActorAvatarMove.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSActorAvatarMove.cs | |||
@@ -47,9 +47,9 @@ public class BSActorAvatarMove : BSActor | |||
47 | // The amount the step up is applying. Used to smooth stair walking. | 47 | // The amount the step up is applying. Used to smooth stair walking. |
48 | float m_lastStepUp; | 48 | float m_lastStepUp; |
49 | 49 | ||
50 | // There are times the velocity is set but we don't want to inforce stationary until the | 50 | // There are times the velocity or force is set but we don't want to inforce |
51 | // real velocity drops. | 51 | // stationary until some tick in the future and the real velocity drops. |
52 | bool m_waitingForLowVelocityForStationary = false; | 52 | int m_waitingForLowVelocityForStationary = 0; |
53 | 53 | ||
54 | public BSActorAvatarMove(BSScene physicsScene, BSPhysObject pObj, string actorName) | 54 | public BSActorAvatarMove(BSScene physicsScene, BSPhysObject pObj, string actorName) |
55 | : base(physicsScene, pObj, actorName) | 55 | : base(physicsScene, pObj, actorName) |
@@ -114,14 +114,18 @@ public class BSActorAvatarMove : BSActor | |||
114 | m_velocityMotor.Enabled = true; | 114 | m_velocityMotor.Enabled = true; |
115 | m_physicsScene.DetailLog("{0},BSCharacter.MoveMotor,SetVelocityAndTarget,vel={1}, targ={2}", | 115 | m_physicsScene.DetailLog("{0},BSCharacter.MoveMotor,SetVelocityAndTarget,vel={1}, targ={2}", |
116 | m_controllingPrim.LocalID, vel, targ); | 116 | m_controllingPrim.LocalID, vel, targ); |
117 | m_waitingForLowVelocityForStationary = false; | 117 | m_waitingForLowVelocityForStationary = 0; |
118 | } | 118 | } |
119 | }); | 119 | }); |
120 | } | 120 | } |
121 | 121 | ||
122 | public void SuppressStationayCheckUntilLowVelocity() | 122 | public void SuppressStationayCheckUntilLowVelocity() |
123 | { | 123 | { |
124 | m_waitingForLowVelocityForStationary = true; | 124 | m_waitingForLowVelocityForStationary = 1; |
125 | } | ||
126 | public void SuppressStationayCheckUntilLowVelocity(int waitTicks) | ||
127 | { | ||
128 | m_waitingForLowVelocityForStationary = waitTicks; | ||
125 | } | 129 | } |
126 | 130 | ||
127 | // If a movement motor has not been created, create one and start the movement | 131 | // If a movement motor has not been created, create one and start the movement |
@@ -143,7 +147,7 @@ public class BSActorAvatarMove : BSActor | |||
143 | m_controllingPrim.OnPreUpdateProperty += Process_OnPreUpdateProperty; | 147 | m_controllingPrim.OnPreUpdateProperty += Process_OnPreUpdateProperty; |
144 | 148 | ||
145 | m_walkingUpStairs = 0; | 149 | m_walkingUpStairs = 0; |
146 | m_waitingForLowVelocityForStationary = false; | 150 | m_waitingForLowVelocityForStationary = 0; |
147 | } | 151 | } |
148 | } | 152 | } |
149 | 153 | ||
@@ -194,15 +198,17 @@ public class BSActorAvatarMove : BSActor | |||
194 | // if colliding with something stationary and we're not doing volume detect . | 198 | // if colliding with something stationary and we're not doing volume detect . |
195 | if (!m_controllingPrim.ColliderIsMoving && !m_controllingPrim.ColliderIsVolumeDetect) | 199 | if (!m_controllingPrim.ColliderIsMoving && !m_controllingPrim.ColliderIsVolumeDetect) |
196 | { | 200 | { |
197 | if (m_waitingForLowVelocityForStationary) | 201 | if (m_waitingForLowVelocityForStationary-- <= 0) |
198 | { | 202 | { |
199 | // if waiting for velocity to drop and it has finally dropped, we can be stationary | 203 | // if waiting for velocity to drop and it has finally dropped, we can be stationary |
204 | // m_physicsScene.DetailLog("{0},BSCharacter.MoveMotor,waitingForLowVelocity {1}", | ||
205 | // m_controllingPrim.LocalID, m_waitingForLowVelocityForStationary); | ||
200 | if (m_controllingPrim.RawVelocity.LengthSquared() < BSParam.AvatarStopZeroThresholdSquared) | 206 | if (m_controllingPrim.RawVelocity.LengthSquared() < BSParam.AvatarStopZeroThresholdSquared) |
201 | { | 207 | { |
202 | m_waitingForLowVelocityForStationary = false; | 208 | m_waitingForLowVelocityForStationary = 0; |
203 | } | 209 | } |
204 | } | 210 | } |
205 | if (!m_waitingForLowVelocityForStationary) | 211 | if (m_waitingForLowVelocityForStationary <= 0) |
206 | { | 212 | { |
207 | m_physicsScene.DetailLog("{0},BSCharacter.MoveMotor,collidingWithStationary,zeroingMotion", m_controllingPrim.LocalID); | 213 | m_physicsScene.DetailLog("{0},BSCharacter.MoveMotor,collidingWithStationary,zeroingMotion", m_controllingPrim.LocalID); |
208 | m_controllingPrim.IsStationary = true; | 214 | m_controllingPrim.IsStationary = true; |
diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs b/OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs index 2ca7dbc..f971e59 100644..100755 --- a/OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs | |||
@@ -701,7 +701,7 @@ public sealed class BSCharacter : BSPhysObject | |||
701 | } | 701 | } |
702 | if (m_moveActor != null) | 702 | if (m_moveActor != null) |
703 | { | 703 | { |
704 | m_moveActor.SuppressStationayCheckUntilLowVelocity(); | 704 | m_moveActor.SuppressStationayCheckUntilLowVelocity(BSParam.AvatarAddForceFrames); |
705 | } | 705 | } |
706 | }); | 706 | }); |
707 | } | 707 | } |
diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSParam.cs b/OpenSim/Region/PhysicsModules/BulletS/BSParam.cs index 495f752..d80b050 100755 --- a/OpenSim/Region/PhysicsModules/BulletS/BSParam.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSParam.cs | |||
@@ -149,6 +149,7 @@ public static class BSParam | |||
149 | public static float AvatarHeightHighFudge { get; private set; } | 149 | public static float AvatarHeightHighFudge { get; private set; } |
150 | public static float AvatarFlyingGroundMargin { get; private set; } | 150 | public static float AvatarFlyingGroundMargin { get; private set; } |
151 | public static float AvatarFlyingGroundUpForce { get; private set; } | 151 | public static float AvatarFlyingGroundUpForce { get; private set; } |
152 | public static int AvatarAddForceFrames { get; private set; } | ||
152 | public static float AvatarTerminalVelocity { get; private set; } | 153 | public static float AvatarTerminalVelocity { get; private set; } |
153 | public static float AvatarContactProcessingThreshold { get; private set; } | 154 | public static float AvatarContactProcessingThreshold { get; private set; } |
154 | public static float AvatarAddForcePushFactor { get; private set; } | 155 | public static float AvatarAddForcePushFactor { get; private set; } |
@@ -634,6 +635,8 @@ public static class BSParam | |||
634 | 5f ), | 635 | 5f ), |
635 | new ParameterDefn<float>("AvatarFlyingGroundUpForce", "Upward force applied to the avatar to keep it at flying ground margin", | 636 | new ParameterDefn<float>("AvatarFlyingGroundUpForce", "Upward force applied to the avatar to keep it at flying ground margin", |
636 | 2.0f ), | 637 | 2.0f ), |
638 | new ParameterDefn<int>("AvatarAddForceFrames", "Frames to allow AddForce to apply before checking for stationary", | ||
639 | 10 ), | ||
637 | new ParameterDefn<float>("AvatarTerminalVelocity", "Terminal Velocity of falling avatar", | 640 | new ParameterDefn<float>("AvatarTerminalVelocity", "Terminal Velocity of falling avatar", |
638 | -54.0f ), | 641 | -54.0f ), |
639 | new ParameterDefn<float>("AvatarContactProcessingThreshold", "Distance from capsule to check for collisions", | 642 | new ParameterDefn<float>("AvatarContactProcessingThreshold", "Distance from capsule to check for collisions", |