diff options
Diffstat (limited to 'OpenSim/Region/PhysicsModules/BulletS/BSActorAvatarMove.cs')
-rwxr-xr-x | OpenSim/Region/PhysicsModules/BulletS/BSActorAvatarMove.cs | 24 |
1 files changed, 15 insertions, 9 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; |