aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs4
-rw-r--r--OpenSim/Region/Physics/ChOdePlugin/ODECharacter.cs20
2 files changed, 22 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index 855a341..8ac09e9 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -1082,7 +1082,9 @@ namespace OpenSim.Region.Framework.Scenes
1082 CheckLandingPoint(ref pos); 1082 CheckLandingPoint(ref pos);
1083 AbsolutePosition = pos; 1083 AbsolutePosition = pos;
1084 AddToPhysicalScene(isFlying); 1084 AddToPhysicalScene(isFlying);
1085 Velocity = vel; 1085 if (PhysicsActor != null)
1086 PhysicsActor.SetMomentum(vel);
1087
1086 SendTerseUpdateToAllClients(); 1088 SendTerseUpdateToAllClients();
1087 } 1089 }
1088 1090
diff --git a/OpenSim/Region/Physics/ChOdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/ChOdePlugin/ODECharacter.cs
index 2945199..1f1ba95 100644
--- a/OpenSim/Region/Physics/ChOdePlugin/ODECharacter.cs
+++ b/OpenSim/Region/Physics/ChOdePlugin/ODECharacter.cs
@@ -140,6 +140,10 @@ namespace OpenSim.Region.Physics.OdePlugin
140 public int m_eventsubscription = 0; 140 public int m_eventsubscription = 0;
141 private CollisionEventUpdate CollisionEventsThisFrame = new CollisionEventUpdate(); 141 private CollisionEventUpdate CollisionEventsThisFrame = new CollisionEventUpdate();
142 142
143 private Vector3 m_taintMomentum = Vector3.Zero;
144 private bool m_haveTaintMomentum = false;
145
146
143 // unique UUID of this character object 147 // unique UUID of this character object
144 public UUID m_uuid; 148 public UUID m_uuid;
145 public bool bad = false; 149 public bool bad = false;
@@ -800,8 +804,8 @@ namespace OpenSim.Region.Physics.OdePlugin
800 { 804 {
801 if (value.IsFinite()) 805 if (value.IsFinite())
802 { 806 {
803 m_pidControllerActive = true;
804 _target_velocity = value; 807 _target_velocity = value;
808 m_pidControllerActive = true;
805 } 809 }
806 else 810 else
807 { 811 {
@@ -911,6 +915,12 @@ namespace OpenSim.Region.Physics.OdePlugin
911 915
912 public override void SetMomentum(Vector3 momentum) 916 public override void SetMomentum(Vector3 momentum)
913 { 917 {
918 if (momentum.IsFinite())
919 {
920 m_taintMomentum = momentum;
921 m_haveTaintMomentum = true;
922 _parent_scene.AddPhysicsActorTaint(this);
923 }
914 } 924 }
915 925
916 926
@@ -1424,6 +1434,14 @@ namespace OpenSim.Region.Physics.OdePlugin
1424 } 1434 }
1425 } 1435 }
1426 1436
1437 if (m_haveTaintMomentum)
1438 {
1439 m_haveTaintMomentum = false;
1440 _velocity = m_taintMomentum;
1441 _target_velocity = m_taintMomentum;
1442 m_pidControllerActive = true;
1443 d.BodySetLinearVel(Body, _velocity.X, _velocity.Y, _velocity.Z);
1444 }
1427 } 1445 }
1428 } 1446 }
1429 1447