diff options
author | Robert Adams | 2016-10-03 20:47:30 -0700 |
---|---|---|
committer | Robert Adams | 2016-10-03 20:47:30 -0700 |
commit | e13fecfd3d465cd51f4d0802b3f2a4d9b2c989b7 (patch) | |
tree | 262ade32cd391ca2e3a7ebe87a48771b85ab52a5 /OpenSim/Region/PhysicsModules/BulletS | |
parent | minor cleanup (diff) | |
download | opensim-SC_OLD-e13fecfd3d465cd51f4d0802b3f2a4d9b2c989b7.zip opensim-SC_OLD-e13fecfd3d465cd51f4d0802b3f2a4d9b2c989b7.tar.gz opensim-SC_OLD-e13fecfd3d465cd51f4d0802b3f2a4d9b2c989b7.tar.bz2 opensim-SC_OLD-e13fecfd3d465cd51f4d0802b3f2a4d9b2c989b7.tar.xz |
BulletSim: zero velocity target when setting velocity through the
SetMomentum method.
Diffstat (limited to 'OpenSim/Region/PhysicsModules/BulletS')
-rw-r--r-- | OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs | 12 | ||||
-rwxr-xr-x | OpenSim/Region/PhysicsModules/BulletS/BSPhysObject.cs | 2 |
2 files changed, 12 insertions, 2 deletions
diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs b/OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs index 213f2eb..757f06c 100644 --- a/OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSCharacter.cs | |||
@@ -350,7 +350,6 @@ public sealed class BSCharacter : BSPhysObject | |||
350 | } | 350 | } |
351 | } | 351 | } |
352 | 352 | ||
353 | |||
354 | // Check that the current position is sane and, if not, modify the position to make it so. | 353 | // Check that the current position is sane and, if not, modify the position to make it so. |
355 | // Check for being below terrain or on water. | 354 | // Check for being below terrain or on water. |
356 | // Returns 'true' of the position was made sane by some action. | 355 | // Returns 'true' of the position was made sane by some action. |
@@ -502,6 +501,17 @@ public sealed class BSCharacter : BSPhysObject | |||
502 | } | 501 | } |
503 | } | 502 | } |
504 | 503 | ||
504 | // SetMomentum just sets the velocity without a target. We need to stop the movement actor if a character. | ||
505 | public override void SetMomentum(OMV.Vector3 momentum) | ||
506 | { | ||
507 | if (m_moveActor != null) | ||
508 | { | ||
509 | m_moveActor.SetVelocityAndTarget(OMV.Vector3.Zero, OMV.Vector3.Zero, false /* inTaintTime */); | ||
510 | } | ||
511 | base.SetMomentum(momentum); | ||
512 | } | ||
513 | |||
514 | |||
505 | public override OMV.Vector3 Torque { | 515 | public override OMV.Vector3 Torque { |
506 | get { return RawTorque; } | 516 | get { return RawTorque; } |
507 | set { RawTorque = value; | 517 | set { RawTorque = value; |
diff --git a/OpenSim/Region/PhysicsModules/BulletS/BSPhysObject.cs b/OpenSim/Region/PhysicsModules/BulletS/BSPhysObject.cs index 7c6f213..3682455 100755 --- a/OpenSim/Region/PhysicsModules/BulletS/BSPhysObject.cs +++ b/OpenSim/Region/PhysicsModules/BulletS/BSPhysObject.cs | |||
@@ -625,7 +625,7 @@ public abstract class BSPhysObject : PhysicsActor | |||
625 | { | 625 | { |
626 | CurrentCollisionFlags = PhysScene.PE.AddToCollisionFlags(PhysBody, CollisionFlags.BS_SUBSCRIBE_COLLISION_EVENTS); | 626 | CurrentCollisionFlags = PhysScene.PE.AddToCollisionFlags(PhysBody, CollisionFlags.BS_SUBSCRIBE_COLLISION_EVENTS); |
627 | DetailLog("{0},{1}.SubscribeEvents,setting collision. ms={2}, collisionFlags={3:x}", | 627 | DetailLog("{0},{1}.SubscribeEvents,setting collision. ms={2}, collisionFlags={3:x}", |
628 | LocalID, TypeName, ms, CurrentCollisionFlags); | 628 | LocalID, TypeName, SubscribedEventsMs, CurrentCollisionFlags); |
629 | } | 629 | } |
630 | }); | 630 | }); |
631 | } | 631 | } |