aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
authorUbitUmarov2012-04-14 05:07:52 +0100
committerUbitUmarov2012-04-14 05:07:52 +0100
commit3999822e13d7ae2f6ab1c19a19a01e0cc7c7acd7 (patch)
tree5296b367d89f3c62f8ad3bf85b09d1f7b67cb8b4 /OpenSim/Region
parentUse presence absolute position to request raycast to camera. Used m_pos maybe... (diff)
downloadopensim-SC-3999822e13d7ae2f6ab1c19a19a01e0cc7c7acd7.zip
opensim-SC-3999822e13d7ae2f6ab1c19a19a01e0cc7c7acd7.tar.gz
opensim-SC-3999822e13d7ae2f6ab1c19a19a01e0cc7c7acd7.tar.bz2
opensim-SC-3999822e13d7ae2f6ab1c19a19a01e0cc7c7acd7.tar.xz
Use chode character actor.SetMomentum() to force full restore Velocity in scenepresence TeleportWithMomentum(), since actor.Velocity was selected by original coders as the input of a desired velocity (even 'forces') that is modified by character conditions, like not changing velocity.Z if it is in free fall.
Diffstat (limited to 'OpenSim/Region')
-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