diff options
Diffstat (limited to 'OpenSim/Region/PhysicsModules')
-rwxr-xr-x | OpenSim/Region/PhysicsModules/BulletS/BSActorAvatarMove.cs | 19 |
1 files changed, 14 insertions, 5 deletions
diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSActorAvatarMove.cs b/OpenSim/Region/PhysicsModules/BulletS/BSActorAvatarMove.cs index 12ffacb..71cd879 100755 --- a/OpenSim/Region/PhysicsModules/BulletS/BSActorAvatarMove.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSActorAvatarMove.cs | |||
@@ -117,11 +117,13 @@ public class BSActorAvatarMove : BSActor | |||
117 | m_velocityMotor.SetTarget(targ); | 117 | m_velocityMotor.SetTarget(targ); |
118 | m_velocityMotor.SetCurrent(vel); | 118 | m_velocityMotor.SetCurrent(vel); |
119 | m_velocityMotor.Enabled = true; | 119 | m_velocityMotor.Enabled = true; |
120 | m_physicsScene.DetailLog("{0},BSCharacter.MoveMotor,SetVelocityAndTarget,vel={1}, targ={2}, inTaintTime={3}", | ||
121 | m_controllingPrim.LocalID, vel, targ, inTaintTime); | ||
120 | } | 122 | } |
121 | }); | 123 | }); |
122 | } | 124 | } |
123 | 125 | ||
124 | // If a hover motor has not been created, create one and start the hovering. | 126 | // If a movement motor has not been created, create one and start the hovering. |
125 | private void ActivateAvatarMove() | 127 | private void ActivateAvatarMove() |
126 | { | 128 | { |
127 | if (m_velocityMotor == null) | 129 | if (m_velocityMotor == null) |
@@ -133,7 +135,7 @@ public class BSActorAvatarMove : BSActor | |||
133 | 1f // efficiency | 135 | 1f // efficiency |
134 | ); | 136 | ); |
135 | m_velocityMotor.ErrorZeroThreshold = BSParam.AvatarStopZeroThreshold; | 137 | m_velocityMotor.ErrorZeroThreshold = BSParam.AvatarStopZeroThreshold; |
136 | // _velocityMotor.PhysicsScene = PhysicsScene; // DEBUG DEBUG so motor will output detail log messages. | 138 | // m_velocityMotor.PhysicsScene = m_controllingPrim.PhysScene; // DEBUG DEBUG so motor will output detail log messages. |
137 | SetVelocityAndTarget(m_controllingPrim.RawVelocity, m_controllingPrim.TargetVelocity, true /* inTaintTime */); | 139 | SetVelocityAndTarget(m_controllingPrim.RawVelocity, m_controllingPrim.TargetVelocity, true /* inTaintTime */); |
138 | 140 | ||
139 | m_physicsScene.BeforeStep += Mover; | 141 | m_physicsScene.BeforeStep += Mover; |
@@ -190,8 +192,14 @@ public class BSActorAvatarMove : BSActor | |||
190 | // if colliding with something stationary and we're not doing volume detect . | 192 | // if colliding with something stationary and we're not doing volume detect . |
191 | if (!m_controllingPrim.ColliderIsMoving && !m_controllingPrim.ColliderIsVolumeDetect) | 193 | if (!m_controllingPrim.ColliderIsMoving && !m_controllingPrim.ColliderIsVolumeDetect) |
192 | { | 194 | { |
193 | m_physicsScene.DetailLog("{0},BSCharacter.MoveMotor,collidingWithStationary,totalForce={1}, vel={2}", /* DEBUG */ | 195 | m_physicsScene.DetailLog("{0},BSCharacter.MoveMotor,collidingWithStationary,zeroingMotion", m_controllingPrim.LocalID); |
194 | m_controllingPrim.LocalID, m_physicsScene.PE.GetTotalForce(m_controllingPrim.PhysBody), m_controllingPrim.Velocity); /* DEBUG */ | 196 | m_controllingPrim.IsStationary = true; |
197 | m_controllingPrim.ZeroMotion(true /* inTaintTime */); | ||
198 | |||
199 | /* 20160118 Attempt to not be stationary if some velocity applied. Caused drifting since still can't tell who applied velocity. | ||
200 | * Solution is to make clearer what is causing the added velocity (push or environment) when deciding if stationary. | ||
201 | m_physicsScene.DetailLog("{0},BSCharacter.MoveMotor,collidingWithStationary,totalForce={1}, vel={2}", | ||
202 | m_controllingPrim.LocalID, m_physicsScene.PE.GetTotalForce(m_controllingPrim.PhysBody), m_controllingPrim.Velocity); | ||
195 | // If velocity is very small, assume it is movement creep and suppress it. | 203 | // If velocity is very small, assume it is movement creep and suppress it. |
196 | // Applying push forces (Character.AddForce) should move the avatar and that is only seen here as velocity. | 204 | // Applying push forces (Character.AddForce) should move the avatar and that is only seen here as velocity. |
197 | if ( (m_controllingPrim.Velocity.LengthSquared() < BSParam.AvatarStopZeroThresholdSquared) | 205 | if ( (m_controllingPrim.Velocity.LengthSquared() < BSParam.AvatarStopZeroThresholdSquared) |
@@ -199,13 +207,14 @@ public class BSActorAvatarMove : BSActor | |||
199 | { | 207 | { |
200 | m_physicsScene.DetailLog("{0},BSCharacter.MoveMotor,collidingWithStationary,zeroingMotion", m_controllingPrim.LocalID); | 208 | m_physicsScene.DetailLog("{0},BSCharacter.MoveMotor,collidingWithStationary,zeroingMotion", m_controllingPrim.LocalID); |
201 | m_controllingPrim.IsStationary = true; | 209 | m_controllingPrim.IsStationary = true; |
202 | m_controllingPrim.ZeroMotion(true /* inTaintTime */); | 210 | m_controllingPrim.ZeroMotion(true); |
203 | } | 211 | } |
204 | else | 212 | else |
205 | { | 213 | { |
206 | m_physicsScene.DetailLog("{0},BSCharacter.MoveMotor,collidingWithStationary,not zeroing because velocity={1}", | 214 | m_physicsScene.DetailLog("{0},BSCharacter.MoveMotor,collidingWithStationary,not zeroing because velocity={1}", |
207 | m_controllingPrim.LocalID, m_controllingPrim.Velocity); | 215 | m_controllingPrim.LocalID, m_controllingPrim.Velocity); |
208 | } | 216 | } |
217 | */ | ||
209 | } | 218 | } |
210 | 219 | ||
211 | // Standing has more friction on the ground | 220 | // Standing has more friction on the ground |