diff options
author | UbitUmarov | 2012-04-14 05:07:52 +0100 |
---|---|---|
committer | UbitUmarov | 2012-04-14 05:07:52 +0100 |
commit | 3999822e13d7ae2f6ab1c19a19a01e0cc7c7acd7 (patch) | |
tree | 5296b367d89f3c62f8ad3bf85b09d1f7b67cb8b4 /OpenSim/Region/Physics/ChOdePlugin/ODECharacter.cs | |
parent | Use presence absolute position to request raycast to camera. Used m_pos maybe... (diff) | |
download | opensim-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 '')
-rw-r--r-- | OpenSim/Region/Physics/ChOdePlugin/ODECharacter.cs | 20 |
1 files changed, 19 insertions, 1 deletions
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 | ||