aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/PhysicsModules/Ode/ODECharacter.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/PhysicsModules/Ode/ODECharacter.cs128
1 files changed, 64 insertions, 64 deletions
diff --git a/OpenSim/Region/PhysicsModules/Ode/ODECharacter.cs b/OpenSim/Region/PhysicsModules/Ode/ODECharacter.cs
index 98bfd1c..441aa22 100644
--- a/OpenSim/Region/PhysicsModules/Ode/ODECharacter.cs
+++ b/OpenSim/Region/PhysicsModules/Ode/ODECharacter.cs
@@ -68,7 +68,7 @@ namespace OpenSim.Region.PhysicsModule.ODE
68 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 68 private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
69 69
70 private Vector3 _position; 70 private Vector3 _position;
71 private d.Vector3 _zeroPosition; 71 private SafeNativeMethods.Vector3 _zeroPosition;
72 private bool _zeroFlag = false; 72 private bool _zeroFlag = false;
73 private bool m_lastUpdateSent = false; 73 private bool m_lastUpdateSent = false;
74 private Vector3 _velocity; 74 private Vector3 _velocity;
@@ -151,7 +151,7 @@ namespace OpenSim.Region.PhysicsModule.ODE
151 internal IntPtr Shell { get; private set; } 151 internal IntPtr Shell { get; private set; }
152 152
153 private IntPtr Amotor = IntPtr.Zero; 153 private IntPtr Amotor = IntPtr.Zero;
154 private d.Mass ShellMass; 154 private SafeNativeMethods.Mass ShellMass;
155 155
156 private int m_eventsubscription = 0; 156 private int m_eventsubscription = 0;
157 private CollisionEventUpdate CollisionEventsThisFrame = new CollisionEventUpdate(); 157 private CollisionEventUpdate CollisionEventsThisFrame = new CollisionEventUpdate();
@@ -569,12 +569,12 @@ namespace OpenSim.Region.PhysicsModule.ODE
569 float yTiltComponent = -movementVector.Y * m_tiltMagnitudeWhenProjectedOnXYPlane; 569 float yTiltComponent = -movementVector.Y * m_tiltMagnitudeWhenProjectedOnXYPlane;
570 570
571 //m_log.Debug("[ODE CHARACTER]: changing avatar tilt"); 571 //m_log.Debug("[ODE CHARACTER]: changing avatar tilt");
572 d.JointSetAMotorParam(Amotor, (int)dParam.LowStop, xTiltComponent); 572 SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.LowStop, xTiltComponent);
573 d.JointSetAMotorParam(Amotor, (int)dParam.HiStop, xTiltComponent); // must be same as lowstop, else a different, spurious tilt is introduced 573 SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.HiStop, xTiltComponent); // must be same as lowstop, else a different, spurious tilt is introduced
574 d.JointSetAMotorParam(Amotor, (int)dParam.LoStop2, yTiltComponent); 574 SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.LoStop2, yTiltComponent);
575 d.JointSetAMotorParam(Amotor, (int)dParam.HiStop2, yTiltComponent); // same as lowstop 575 SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.HiStop2, yTiltComponent); // same as lowstop
576 d.JointSetAMotorParam(Amotor, (int)dParam.LoStop3, 0f); 576 SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.LoStop3, 0f);
577 d.JointSetAMotorParam(Amotor, (int)dParam.HiStop3, 0f); // same as lowstop 577 SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.HiStop3, 0f); // same as lowstop
578 } 578 }
579 579
580 /// <summary> 580 /// <summary>
@@ -805,11 +805,11 @@ namespace OpenSim.Region.PhysicsModule.ODE
805 805
806 if (m_pidControllerActive == false) 806 if (m_pidControllerActive == false)
807 { 807 {
808 _zeroPosition = d.BodyGetPosition(Body); 808 _zeroPosition = SafeNativeMethods.BodyGetPosition(Body);
809 } 809 }
810 //PidStatus = true; 810 //PidStatus = true;
811 811
812 d.Vector3 localpos = d.BodyGetPosition(Body); 812 SafeNativeMethods.Vector3 localpos = SafeNativeMethods.BodyGetPosition(Body);
813 Vector3 localPos = new Vector3(localpos.X, localpos.Y, localpos.Z); 813 Vector3 localPos = new Vector3(localpos.X, localpos.Y, localpos.Z);
814 814
815 if (!localPos.IsFinite()) 815 if (!localPos.IsFinite())
@@ -824,7 +824,7 @@ namespace OpenSim.Region.PhysicsModule.ODE
824 } 824 }
825 825
826 Vector3 vec = Vector3.Zero; 826 Vector3 vec = Vector3.Zero;
827 d.Vector3 vel = d.BodyGetLinearVel(Body); 827 SafeNativeMethods.Vector3 vel = SafeNativeMethods.BodyGetLinearVel(Body);
828 828
829// m_log.DebugFormat( 829// m_log.DebugFormat(
830// "[ODE CHARACTER]: Current velocity in Move() is <{0},{1},{2}>, target {3} for {4}", 830// "[ODE CHARACTER]: Current velocity in Move() is <{0},{1},{2}>, target {3} for {4}",
@@ -848,7 +848,7 @@ namespace OpenSim.Region.PhysicsModule.ODE
848 if (!_zeroFlag) 848 if (!_zeroFlag)
849 { 849 {
850 _zeroFlag = true; 850 _zeroFlag = true;
851 _zeroPosition = d.BodyGetPosition(Body); 851 _zeroPosition = SafeNativeMethods.BodyGetPosition(Body);
852 } 852 }
853 853
854 if (m_pidControllerActive) 854 if (m_pidControllerActive)
@@ -858,7 +858,7 @@ namespace OpenSim.Region.PhysicsModule.ODE
858 // Avatar to Avatar collisions 858 // Avatar to Avatar collisions
859 // Prim to avatar collisions 859 // Prim to avatar collisions
860 860
861 d.Vector3 pos = d.BodyGetPosition(Body); 861 SafeNativeMethods.Vector3 pos = SafeNativeMethods.BodyGetPosition(Body);
862 vec.X = (_target_velocity.X - vel.X) * (PID_D) + (_zeroPosition.X - pos.X) * (PID_P * 2); 862 vec.X = (_target_velocity.X - vel.X) * (PID_D) + (_zeroPosition.X - pos.X) * (PID_P * 2);
863 vec.Y = (_target_velocity.Y - vel.Y) * (PID_D) + (_zeroPosition.Y - pos.Y)* (PID_P * 2); 863 vec.Y = (_target_velocity.Y - vel.Y) * (PID_D) + (_zeroPosition.Y - pos.Y)* (PID_P * 2);
864 if (flying) 864 if (flying)
@@ -906,7 +906,7 @@ namespace OpenSim.Region.PhysicsModule.ODE
906 { 906 {
907 // We're colliding with something and we're not flying but we're moving 907 // We're colliding with something and we're not flying but we're moving
908 // This means we're walking or running. 908 // This means we're walking or running.
909 d.Vector3 pos = d.BodyGetPosition(Body); 909 SafeNativeMethods.Vector3 pos = SafeNativeMethods.BodyGetPosition(Body);
910 vec.Z = (_target_velocity.Z - vel.Z) * PID_D + (_zeroPosition.Z - pos.Z) * PID_P; 910 vec.Z = (_target_velocity.Z - vel.Z) * PID_D + (_zeroPosition.Z - pos.Z) * PID_P;
911 vec.X = ((_target_velocity.X - vel.X) / 1.2f) * PID_D; 911 vec.X = ((_target_velocity.X - vel.X) / 1.2f) * PID_D;
912 vec.Y = ((_target_velocity.Y - vel.Y) / 1.2f) * PID_D; 912 vec.Y = ((_target_velocity.Y - vel.Y) / 1.2f) * PID_D;
@@ -940,7 +940,7 @@ namespace OpenSim.Region.PhysicsModule.ODE
940 if (vec.IsFinite()) 940 if (vec.IsFinite())
941 { 941 {
942 // Apply the total force acting on this avatar 942 // Apply the total force acting on this avatar
943 d.BodyAddForce(Body, vec.X, vec.Y, vec.Z); 943 SafeNativeMethods.BodyAddForce(Body, vec.X, vec.Y, vec.Z);
944 944
945 if (!_zeroFlag) 945 if (!_zeroFlag)
946 AlignAvatarTiltWithCurrentDirectionOfMovement(vec); 946 AlignAvatarTiltWithCurrentDirectionOfMovement(vec);
@@ -956,7 +956,7 @@ namespace OpenSim.Region.PhysicsModule.ODE
956 return; 956 return;
957 } 957 }
958 958
959 d.Vector3 newVel = d.BodyGetLinearVel(Body); 959 SafeNativeMethods.Vector3 newVel = SafeNativeMethods.BodyGetLinearVel(Body);
960 if (newVel.X >= 256 || newVel.X <= 256 || newVel.Y >= 256 || newVel.Y <= 256 || newVel.Z >= 256 || newVel.Z <= 256) 960 if (newVel.X >= 256 || newVel.X <= 256 || newVel.Y >= 256 || newVel.Y <= 256 || newVel.Z >= 256 || newVel.Z <= 256)
961 { 961 {
962// m_log.DebugFormat( 962// m_log.DebugFormat(
@@ -972,7 +972,7 @@ namespace OpenSim.Region.PhysicsModule.ODE
972 else 972 else
973 newVel.Z = Util.Clamp<float>(newVel.Z, -255f, 255f); 973 newVel.Z = Util.Clamp<float>(newVel.Z, -255f, 255f);
974 974
975 d.BodySetLinearVel(Body, newVel.X, newVel.Y, newVel.Z); 975 SafeNativeMethods.BodySetLinearVel(Body, newVel.X, newVel.Y, newVel.Z);
976 } 976 }
977 } 977 }
978 978
@@ -985,16 +985,16 @@ namespace OpenSim.Region.PhysicsModule.ODE
985 internal void UpdatePositionAndVelocity(List<OdeCharacter> defects) 985 internal void UpdatePositionAndVelocity(List<OdeCharacter> defects)
986 { 986 {
987 // no lock; called from Simulate() -- if you call this from elsewhere, gotta lock or do Monitor.Enter/Exit! 987 // no lock; called from Simulate() -- if you call this from elsewhere, gotta lock or do Monitor.Enter/Exit!
988 d.Vector3 newPos; 988 SafeNativeMethods.Vector3 newPos;
989 try 989 try
990 { 990 {
991 newPos = d.BodyGetPosition(Body); 991 newPos = SafeNativeMethods.BodyGetPosition(Body);
992 } 992 }
993 catch (NullReferenceException) 993 catch (NullReferenceException)
994 { 994 {
995 bad = true; 995 bad = true;
996 defects.Add(this); 996 defects.Add(this);
997 newPos = new d.Vector3(_position.X, _position.Y, _position.Z); 997 newPos = new SafeNativeMethods.Vector3(_position.X, _position.Y, _position.Z);
998 base.RaiseOutOfBounds(_position); // Tells ScenePresence that there's a problem! 998 base.RaiseOutOfBounds(_position); // Tells ScenePresence that there's a problem!
999 m_log.WarnFormat("[ODE CHARACTER]: Avatar Null reference for Avatar {0}, physical actor {1}", Name, m_uuid); 999 m_log.WarnFormat("[ODE CHARACTER]: Avatar Null reference for Avatar {0}, physical actor {1}", Name, m_uuid);
1000 1000
@@ -1031,11 +1031,11 @@ namespace OpenSim.Region.PhysicsModule.ODE
1031 else 1031 else
1032 { 1032 {
1033 m_lastUpdateSent = false; 1033 m_lastUpdateSent = false;
1034 d.Vector3 newVelocity; 1034 SafeNativeMethods.Vector3 newVelocity;
1035 1035
1036 try 1036 try
1037 { 1037 {
1038 newVelocity = d.BodyGetLinearVel(Body); 1038 newVelocity = SafeNativeMethods.BodyGetLinearVel(Body);
1039 } 1039 }
1040 catch (NullReferenceException) 1040 catch (NullReferenceException)
1041 { 1041 {
@@ -1102,14 +1102,14 @@ namespace OpenSim.Region.PhysicsModule.ODE
1102 } 1102 }
1103 1103
1104// lock (OdeScene.UniversalColliderSyncObject) 1104// lock (OdeScene.UniversalColliderSyncObject)
1105 Shell = d.CreateCapsule(_parent_scene.space, CAPSULE_RADIUS, CAPSULE_LENGTH); 1105 Shell = SafeNativeMethods.CreateCapsule(_parent_scene.space, CAPSULE_RADIUS, CAPSULE_LENGTH);
1106 1106
1107 d.GeomSetCategoryBits(Shell, (uint)m_collisionCategories); 1107 SafeNativeMethods.GeomSetCategoryBits(Shell, (uint)m_collisionCategories);
1108 d.GeomSetCollideBits(Shell, (uint)m_collisionFlags); 1108 SafeNativeMethods.GeomSetCollideBits(Shell, (uint)m_collisionFlags);
1109 1109
1110 d.MassSetCapsuleTotal(out ShellMass, m_mass, 2, CAPSULE_RADIUS, CAPSULE_LENGTH); 1110 SafeNativeMethods.MassSetCapsuleTotal(out ShellMass, m_mass, 2, CAPSULE_RADIUS, CAPSULE_LENGTH);
1111 Body = d.BodyCreate(_parent_scene.world); 1111 Body = SafeNativeMethods.BodyCreate(_parent_scene.world);
1112 d.BodySetPosition(Body, npositionX, npositionY, npositionZ); 1112 SafeNativeMethods.BodySetPosition(Body, npositionX, npositionY, npositionZ);
1113 1113
1114 _position.X = npositionX; 1114 _position.X = npositionX;
1115 _position.Y = npositionY; 1115 _position.Y = npositionY;
@@ -1117,45 +1117,45 @@ namespace OpenSim.Region.PhysicsModule.ODE
1117 1117
1118 m_taintPosition = _position; 1118 m_taintPosition = _position;
1119 1119
1120 d.BodySetMass(Body, ref ShellMass); 1120 SafeNativeMethods.BodySetMass(Body, ref ShellMass);
1121 d.Matrix3 m_caprot; 1121 SafeNativeMethods.Matrix3 m_caprot;
1122 // 90 Stand up on the cap of the capped cyllinder 1122 // 90 Stand up on the cap of the capped cyllinder
1123 if (_parent_scene.IsAvCapsuleTilted) 1123 if (_parent_scene.IsAvCapsuleTilted)
1124 { 1124 {
1125 d.RFromAxisAndAngle(out m_caprot, 1, 0, 1, (float)(Math.PI / 2)); 1125 SafeNativeMethods.RFromAxisAndAngle(out m_caprot, 1, 0, 1, (float)(Math.PI / 2));
1126 } 1126 }
1127 else 1127 else
1128 { 1128 {
1129 d.RFromAxisAndAngle(out m_caprot, 0, 0, 1, (float)(Math.PI / 2)); 1129 SafeNativeMethods.RFromAxisAndAngle(out m_caprot, 0, 0, 1, (float)(Math.PI / 2));
1130 } 1130 }
1131 1131
1132 d.GeomSetRotation(Shell, ref m_caprot); 1132 SafeNativeMethods.GeomSetRotation(Shell, ref m_caprot);
1133 d.BodySetRotation(Body, ref m_caprot); 1133 SafeNativeMethods.BodySetRotation(Body, ref m_caprot);
1134 1134
1135 d.GeomSetBody(Shell, Body); 1135 SafeNativeMethods.GeomSetBody(Shell, Body);
1136 1136
1137 // The purpose of the AMotor here is to keep the avatar's physical 1137 // The purpose of the AMotor here is to keep the avatar's physical
1138 // surrogate from rotating while moving 1138 // surrogate from rotating while moving
1139 Amotor = d.JointCreateAMotor(_parent_scene.world, IntPtr.Zero); 1139 Amotor = SafeNativeMethods.JointCreateAMotor(_parent_scene.world, IntPtr.Zero);
1140 d.JointAttach(Amotor, Body, IntPtr.Zero); 1140 SafeNativeMethods.JointAttach(Amotor, Body, IntPtr.Zero);
1141 d.JointSetAMotorMode(Amotor, dAMotorEuler); 1141 SafeNativeMethods.JointSetAMotorMode(Amotor, dAMotorEuler);
1142 d.JointSetAMotorNumAxes(Amotor, 3); 1142 SafeNativeMethods.JointSetAMotorNumAxes(Amotor, 3);
1143 d.JointSetAMotorAxis(Amotor, 0, 0, 1, 0, 0); 1143 SafeNativeMethods.JointSetAMotorAxis(Amotor, 0, 0, 1, 0, 0);
1144 d.JointSetAMotorAxis(Amotor, 1, 0, 0, 1, 0); 1144 SafeNativeMethods.JointSetAMotorAxis(Amotor, 1, 0, 0, 1, 0);
1145 d.JointSetAMotorAxis(Amotor, 2, 0, 0, 0, 1); 1145 SafeNativeMethods.JointSetAMotorAxis(Amotor, 2, 0, 0, 0, 1);
1146 d.JointSetAMotorAngle(Amotor, 0, 0); 1146 SafeNativeMethods.JointSetAMotorAngle(Amotor, 0, 0);
1147 d.JointSetAMotorAngle(Amotor, 1, 0); 1147 SafeNativeMethods.JointSetAMotorAngle(Amotor, 1, 0);
1148 d.JointSetAMotorAngle(Amotor, 2, 0); 1148 SafeNativeMethods.JointSetAMotorAngle(Amotor, 2, 0);
1149 1149
1150 // These lowstops and high stops are effectively (no wiggle room) 1150 // These lowstops and high stops are effectively (no wiggle room)
1151 if (_parent_scene.IsAvCapsuleTilted) 1151 if (_parent_scene.IsAvCapsuleTilted)
1152 { 1152 {
1153 d.JointSetAMotorParam(Amotor, (int)dParam.LowStop, -0.000000000001f); 1153 SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.LowStop, -0.000000000001f);
1154 d.JointSetAMotorParam(Amotor, (int)dParam.LoStop3, -0.000000000001f); 1154 SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.LoStop3, -0.000000000001f);
1155 d.JointSetAMotorParam(Amotor, (int)dParam.LoStop2, -0.000000000001f); 1155 SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.LoStop2, -0.000000000001f);
1156 d.JointSetAMotorParam(Amotor, (int)dParam.HiStop, 0.000000000001f); 1156 SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.HiStop, 0.000000000001f);
1157 d.JointSetAMotorParam(Amotor, (int)dParam.HiStop3, 0.000000000001f); 1157 SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.HiStop3, 0.000000000001f);
1158 d.JointSetAMotorParam(Amotor, (int)dParam.HiStop2, 0.000000000001f); 1158 SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.HiStop2, 0.000000000001f);
1159 } 1159 }
1160 else 1160 else
1161 { 1161 {
@@ -1167,18 +1167,18 @@ namespace OpenSim.Region.PhysicsModule.ODE
1167 // to be comprehended in their entirety. 1167 // to be comprehended in their entirety.
1168 #endregion 1168 #endregion
1169 AlignAvatarTiltWithCurrentDirectionOfMovement(Vector3.Zero); 1169 AlignAvatarTiltWithCurrentDirectionOfMovement(Vector3.Zero);
1170 d.JointSetAMotorParam(Amotor, (int)dParam.LowStop, 0.08f); 1170 SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.LowStop, 0.08f);
1171 d.JointSetAMotorParam(Amotor, (int)dParam.LoStop3, -0f); 1171 SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.LoStop3, -0f);
1172 d.JointSetAMotorParam(Amotor, (int)dParam.LoStop2, 0.08f); 1172 SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.LoStop2, 0.08f);
1173 d.JointSetAMotorParam(Amotor, (int)dParam.HiStop, 0.08f); // must be same as lowstop, else a different, spurious tilt is introduced 1173 SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.HiStop, 0.08f); // must be same as lowstop, else a different, spurious tilt is introduced
1174 d.JointSetAMotorParam(Amotor, (int)dParam.HiStop3, 0f); // same as lowstop 1174 SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.HiStop3, 0f); // same as lowstop
1175 d.JointSetAMotorParam(Amotor, (int)dParam.HiStop2, 0.08f); // same as lowstop 1175 SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.HiStop2, 0.08f); // same as lowstop
1176 } 1176 }
1177 1177
1178 // Fudge factor is 1f by default, we're setting it to 0. We don't want it to Fudge or the 1178 // Fudge factor is 1f by default, we're setting it to 0. We don't want it to Fudge or the
1179 // capped cyllinder will fall over 1179 // capped cyllinder will fall over
1180 d.JointSetAMotorParam(Amotor, (int)dParam.FudgeFactor, 0f); 1180 SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.FudgeFactor, 0f);
1181 d.JointSetAMotorParam(Amotor, (int)dParam.FMax, tensor); 1181 SafeNativeMethods.JointSetAMotorParam(Amotor, (int)dParam.FMax, tensor);
1182 1182
1183 //d.Matrix3 bodyrotation = d.BodyGetRotation(Body); 1183 //d.Matrix3 bodyrotation = d.BodyGetRotation(Body);
1184 //d.QfromR( 1184 //d.QfromR(
@@ -1217,7 +1217,7 @@ namespace OpenSim.Region.PhysicsModule.ODE
1217 if (Amotor != IntPtr.Zero) 1217 if (Amotor != IntPtr.Zero)
1218 { 1218 {
1219 // Kill the Amotor 1219 // Kill the Amotor
1220 d.JointDestroy(Amotor); 1220 SafeNativeMethods.JointDestroy(Amotor);
1221 Amotor = IntPtr.Zero; 1221 Amotor = IntPtr.Zero;
1222 } 1222 }
1223 1223
@@ -1227,14 +1227,14 @@ namespace OpenSim.Region.PhysicsModule.ODE
1227 if (Body != IntPtr.Zero) 1227 if (Body != IntPtr.Zero)
1228 { 1228 {
1229 //kill the body 1229 //kill the body
1230 d.BodyDestroy(Body); 1230 SafeNativeMethods.BodyDestroy(Body);
1231 Body = IntPtr.Zero; 1231 Body = IntPtr.Zero;
1232 } 1232 }
1233 1233
1234 if (Shell != IntPtr.Zero) 1234 if (Shell != IntPtr.Zero)
1235 { 1235 {
1236// lock (OdeScene.UniversalColliderSyncObject) 1236// lock (OdeScene.UniversalColliderSyncObject)
1237 d.GeomDestroy(Shell); 1237 SafeNativeMethods.GeomDestroy(Shell);
1238 1238
1239 _parent_scene.geom_name_map.Remove(Shell); 1239 _parent_scene.geom_name_map.Remove(Shell);
1240 _parent_scene.actor_name_map.Remove(Shell); 1240 _parent_scene.actor_name_map.Remove(Shell);
@@ -1325,7 +1325,7 @@ namespace OpenSim.Region.PhysicsModule.ODE
1325 { 1325 {
1326 if (Body != IntPtr.Zero) 1326 if (Body != IntPtr.Zero)
1327 { 1327 {
1328 d.BodySetPosition(Body, m_taintPosition.X, m_taintPosition.Y, m_taintPosition.Z); 1328 SafeNativeMethods.BodySetPosition(Body, m_taintPosition.X, m_taintPosition.Y, m_taintPosition.Z);
1329 _position = m_taintPosition; 1329 _position = m_taintPosition;
1330 } 1330 }
1331 } 1331 }
@@ -1337,7 +1337,7 @@ namespace OpenSim.Region.PhysicsModule.ODE
1337 // FIXME: This is not a good solution since it's subject to a race condition if a force is another 1337 // FIXME: This is not a good solution since it's subject to a race condition if a force is another
1338 // thread sets a new force while we're in this loop (since it could be obliterated by 1338 // thread sets a new force while we're in this loop (since it could be obliterated by
1339 // m_taintForce = Vector3.Zero. Need to lock ProcessTaints() when we set a new tainted force. 1339 // m_taintForce = Vector3.Zero. Need to lock ProcessTaints() when we set a new tainted force.
1340 d.BodyAddForce(Body, m_taintForce.X, m_taintForce.Y, m_taintForce.Z); 1340 SafeNativeMethods.BodyAddForce(Body, m_taintForce.X, m_taintForce.Y, m_taintForce.Z);
1341 } 1341 }
1342 1342
1343 m_taintForce = Vector3.Zero; 1343 m_taintForce = Vector3.Zero;