diff options
author | Teravus Ovares | 2008-02-17 10:41:08 +0000 |
---|---|---|
committer | Teravus Ovares | 2008-02-17 10:41:08 +0000 |
commit | 19e0ada93af347cff93a3950f66abe245399f8b2 (patch) | |
tree | 7578573f583e3037e19fc2db471209ea172f0b1c /OpenSim/Region/Physics/OdePlugin | |
parent | Thank you very much, ChrisDown for a patch to (diff) | |
download | opensim-SC_OLD-19e0ada93af347cff93a3950f66abe245399f8b2.zip opensim-SC_OLD-19e0ada93af347cff93a3950f66abe245399f8b2.tar.gz opensim-SC_OLD-19e0ada93af347cff93a3950f66abe245399f8b2.tar.bz2 opensim-SC_OLD-19e0ada93af347cff93a3950f66abe245399f8b2.tar.xz |
* Located and destroyed the weird velocity and rotation transfers. It turned out to be that the Static PhysicsVector.Zero was transferring velocities between all non fixed objects. Not so static after all :(. Finding it was cruel and unusual punishment from the CLR.
* Therefore, when you run through a pile of prim you won't see things rotate when they're not supposed to anymore.
* Avatars don't float off either.
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin')
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 10 | ||||
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | 20 |
2 files changed, 21 insertions, 9 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index 6b8d0e2..0f1446c 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | |||
@@ -317,6 +317,11 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
317 | m_pidControllerActive = status; | 317 | m_pidControllerActive = status; |
318 | } | 318 | } |
319 | 319 | ||
320 | public override bool Stopped | ||
321 | { | ||
322 | get { return _zeroFlag; } | ||
323 | } | ||
324 | |||
320 | /// <summary> | 325 | /// <summary> |
321 | /// This 'puts' an avatar somewhere in the physics space. | 326 | /// This 'puts' an avatar somewhere in the physics space. |
322 | /// Not really a good choice unless you 'know' it's a good | 327 | /// Not really a good choice unless you 'know' it's a good |
@@ -509,8 +514,9 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
509 | public override PhysicsVector Velocity | 514 | public override PhysicsVector Velocity |
510 | { | 515 | { |
511 | get { | 516 | get { |
517 | // There's a problem with PhysicsVector.Zero! Don't Use it Here! | ||
512 | if (_zeroFlag) | 518 | if (_zeroFlag) |
513 | return PhysicsVector.Zero; | 519 | return new PhysicsVector(0f, 0f, 0f); |
514 | m_lastUpdateSent = false; | 520 | m_lastUpdateSent = false; |
515 | return _velocity; | 521 | return _velocity; |
516 | } | 522 | } |
@@ -756,7 +762,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
756 | if (!m_lastUpdateSent) | 762 | if (!m_lastUpdateSent) |
757 | { | 763 | { |
758 | m_lastUpdateSent = true; | 764 | m_lastUpdateSent = true; |
759 | base.RequestPhysicsterseUpdate(); | 765 | //base.RequestPhysicsterseUpdate(); |
760 | 766 | ||
761 | } | 767 | } |
762 | } | 768 | } |
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs index fae5316..b41153b 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | |||
@@ -1129,6 +1129,11 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1129 | set { m_throttleUpdates = value; } | 1129 | set { m_throttleUpdates = value; } |
1130 | } | 1130 | } |
1131 | 1131 | ||
1132 | public override bool Stopped | ||
1133 | { | ||
1134 | get { return _zeroFlag; } | ||
1135 | } | ||
1136 | |||
1132 | public override PhysicsVector Position | 1137 | public override PhysicsVector Position |
1133 | { | 1138 | { |
1134 | get { return _position; } | 1139 | get { return _position; } |
@@ -1233,12 +1238,13 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1233 | public override PhysicsVector RotationalVelocity | 1238 | public override PhysicsVector RotationalVelocity |
1234 | { | 1239 | { |
1235 | get { | 1240 | get { |
1241 | PhysicsVector pv = new PhysicsVector(0, 0, 0); | ||
1236 | if (_zeroFlag) | 1242 | if (_zeroFlag) |
1237 | return PhysicsVector.Zero; | 1243 | return pv; |
1238 | m_lastUpdateSent = false; | 1244 | m_lastUpdateSent = false; |
1239 | 1245 | ||
1240 | if (m_rotationalVelocity.IsIdentical(PhysicsVector.Zero, 0.2f)) | 1246 | if (m_rotationalVelocity.IsIdentical(pv, 0.2f)) |
1241 | return PhysicsVector.Zero; | 1247 | return pv; |
1242 | 1248 | ||
1243 | return m_rotationalVelocity; | 1249 | return m_rotationalVelocity; |
1244 | } | 1250 | } |
@@ -1261,7 +1267,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1261 | public void UpdatePositionAndVelocity() | 1267 | public void UpdatePositionAndVelocity() |
1262 | { | 1268 | { |
1263 | // no lock; called from Simulate() -- if you call this from elsewhere, gotta lock or do Monitor.Enter/Exit! | 1269 | // no lock; called from Simulate() -- if you call this from elsewhere, gotta lock or do Monitor.Enter/Exit! |
1264 | 1270 | PhysicsVector pv = new PhysicsVector(0, 0, 0); | |
1265 | if (Body != (IntPtr) 0) | 1271 | if (Body != (IntPtr) 0) |
1266 | { | 1272 | { |
1267 | d.Vector3 vec = d.BodyGetPosition(Body); | 1273 | d.Vector3 vec = d.BodyGetPosition(Body); |
@@ -1348,7 +1354,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1348 | { | 1354 | { |
1349 | m_throttleUpdates = false; | 1355 | m_throttleUpdates = false; |
1350 | throttleCounter = 0; | 1356 | throttleCounter = 0; |
1351 | m_rotationalVelocity = PhysicsVector.Zero; | 1357 | m_rotationalVelocity = pv; |
1352 | base.RequestPhysicsterseUpdate(); | 1358 | base.RequestPhysicsterseUpdate(); |
1353 | m_lastUpdateSent = true; | 1359 | m_lastUpdateSent = true; |
1354 | } | 1360 | } |
@@ -1362,9 +1368,9 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1362 | _velocity.X = vel.X; | 1368 | _velocity.X = vel.X; |
1363 | _velocity.Y = vel.Y; | 1369 | _velocity.Y = vel.Y; |
1364 | _velocity.Z = vel.Z; | 1370 | _velocity.Z = vel.Z; |
1365 | if (_velocity.IsIdentical(PhysicsVector.Zero, 0.5f)) | 1371 | if (_velocity.IsIdentical(pv, 0.5f)) |
1366 | { | 1372 | { |
1367 | m_rotationalVelocity = PhysicsVector.Zero; | 1373 | m_rotationalVelocity = pv; |
1368 | } | 1374 | } |
1369 | else | 1375 | else |
1370 | { | 1376 | { |