aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-11-21 19:58:37 +0000
committerJustin Clark-Casey (justincc)2011-11-21 19:58:37 +0000
commit063f0f5d97d8b8d38a57c7a0601e9133d0054a26 (patch)
treefcd4028ea59f7725f9814087d2289a77aa21ff68 /OpenSim/Region
parentComment out calls to OdeScene.waitForSpaceUnlock() since that method does not... (diff)
downloadopensim-SC_OLD-063f0f5d97d8b8d38a57c7a0601e9133d0054a26.zip
opensim-SC_OLD-063f0f5d97d8b8d38a57c7a0601e9133d0054a26.tar.gz
opensim-SC_OLD-063f0f5d97d8b8d38a57c7a0601e9133d0054a26.tar.bz2
opensim-SC_OLD-063f0f5d97d8b8d38a57c7a0601e9133d0054a26.tar.xz
refactor: Eliminate one line ODECharacter.doForce() method for code clarity
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODECharacter.cs18
1 files changed, 3 insertions, 15 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
index af67407..afa8de5 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
@@ -70,7 +70,6 @@ namespace OpenSim.Region.Physics.OdePlugin
70 70
71 private Vector3 _position; 71 private Vector3 _position;
72 private d.Vector3 _zeroPosition; 72 private d.Vector3 _zeroPosition;
73 // private d.Matrix3 m_StandUpRotation;
74 private bool _zeroFlag = false; 73 private bool _zeroFlag = false;
75 private bool m_lastUpdateSent = false; 74 private bool m_lastUpdateSent = false;
76 private Vector3 _velocity; 75 private Vector3 _velocity;
@@ -554,8 +553,6 @@ namespace OpenSim.Region.Physics.OdePlugin
554 // place that is safe to call this routine AvatarGeomAndBodyCreation. 553 // place that is safe to call this routine AvatarGeomAndBodyCreation.
555 private void AvatarGeomAndBodyCreation(float npositionX, float npositionY, float npositionZ, float tensor) 554 private void AvatarGeomAndBodyCreation(float npositionX, float npositionY, float npositionZ, float tensor)
556 { 555 {
557 //CAPSULE_LENGTH = -5;
558 //CAPSULE_RADIUS = -5;
559 int dAMotorEuler = 1; 556 int dAMotorEuler = 1;
560// _parent_scene.waitForSpaceUnlock(_parent_scene.space); 557// _parent_scene.waitForSpaceUnlock(_parent_scene.space);
561 if (CAPSULE_LENGTH <= 0) 558 if (CAPSULE_LENGTH <= 0)
@@ -831,7 +828,6 @@ namespace OpenSim.Region.Physics.OdePlugin
831 m_taintForce += force; 828 m_taintForce += force;
832 _parent_scene.AddPhysicsActorTaint(this); 829 _parent_scene.AddPhysicsActorTaint(this);
833 830
834 //doForce(force);
835 // If uncommented, things get pushed off world 831 // If uncommented, things get pushed off world
836 // 832 //
837 // m_log.Debug("Push!"); 833 // m_log.Debug("Push!");
@@ -856,15 +852,6 @@ namespace OpenSim.Region.Physics.OdePlugin
856 { 852 {
857 } 853 }
858 854
859 /// <summary>
860 /// After all of the forces add up with 'add force' we apply them with doForce
861 /// </summary>
862 /// <param name="force"></param>
863 public void doForce(Vector3 force)
864 {
865 d.BodyAddForce(Body, force.X, force.Y, force.Z);
866 }
867
868 public override void SetMomentum(Vector3 momentum) 855 public override void SetMomentum(Vector3 momentum)
869 { 856 {
870 } 857 }
@@ -1030,7 +1017,8 @@ namespace OpenSim.Region.Physics.OdePlugin
1030 1017
1031 if (vec.IsFinite()) 1018 if (vec.IsFinite())
1032 { 1019 {
1033 doForce(vec); 1020 // Apply the total force acting on this avatar
1021 d.BodyAddForce(Body, vec.X, vec.Y, vec.Z);
1034 1022
1035 if (!_zeroFlag) 1023 if (!_zeroFlag)
1036 AlignAvatarTiltWithCurrentDirectionOfMovement(vec); 1024 AlignAvatarTiltWithCurrentDirectionOfMovement(vec);
@@ -1258,7 +1246,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1258 // FIXME: This is not a good solution since it's subject to a race condition if a force is another 1246 // FIXME: This is not a good solution since it's subject to a race condition if a force is another
1259 // thread sets a new force while we're in this loop (since it could be obliterated by 1247 // thread sets a new force while we're in this loop (since it could be obliterated by
1260 // m_taintForce = Vector3.Zero. Need to lock ProcessTaints() when we set a new tainted force. 1248 // m_taintForce = Vector3.Zero. Need to lock ProcessTaints() when we set a new tainted force.
1261 doForce(m_taintForce); 1249 d.BodyAddForce(Body, m_taintForce.X, m_taintForce.Y, m_taintForce.Z);
1262 } 1250 }
1263 1251
1264 m_taintForce = Vector3.Zero; 1252 m_taintForce = Vector3.Zero;