diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/EntityBase.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Environment/Scenes/ScenePresence.cs | 36 |
2 files changed, 31 insertions, 7 deletions
diff --git a/OpenSim/Region/Environment/Scenes/EntityBase.cs b/OpenSim/Region/Environment/Scenes/EntityBase.cs index 7a3b9a7..3ae8cde 100644 --- a/OpenSim/Region/Environment/Scenes/EntityBase.cs +++ b/OpenSim/Region/Environment/Scenes/EntityBase.cs | |||
@@ -87,7 +87,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
87 | protected Vector3 m_rotationalvelocity; | 87 | protected Vector3 m_rotationalvelocity; |
88 | 88 | ||
89 | /// <summary> | 89 | /// <summary> |
90 | /// | 90 | /// Current velocity of the entity. |
91 | /// </summary> | 91 | /// </summary> |
92 | public virtual Vector3 Velocity | 92 | public virtual Vector3 Velocity |
93 | { | 93 | { |
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 2c10a3f..c32691f 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -402,12 +402,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
402 | } | 402 | } |
403 | 403 | ||
404 | m_pos = value; | 404 | m_pos = value; |
405 | m_parentPosition=new Vector3(0, 0, 0); | 405 | m_parentPosition = new Vector3(0, 0, 0); |
406 | } | 406 | } |
407 | } | 407 | } |
408 | 408 | ||
409 | /// <summary> | 409 | /// <summary> |
410 | /// Current Velocity of the avatar. | 410 | /// Current velocity of the avatar. |
411 | /// </summary> | 411 | /// </summary> |
412 | public override Vector3 Velocity | 412 | public override Vector3 Velocity |
413 | { | 413 | { |
@@ -424,6 +424,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
424 | } | 424 | } |
425 | set | 425 | set |
426 | { | 426 | { |
427 | //m_log.DebugFormat("In {0} setting velocity of {1} to {2}", m_scene.RegionInfo.RegionName, Name, value); | ||
428 | |||
427 | if (m_physicsActor != null) | 429 | if (m_physicsActor != null) |
428 | { | 430 | { |
429 | try | 431 | try |
@@ -777,7 +779,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
777 | 779 | ||
778 | AddToPhysicalScene(); | 780 | AddToPhysicalScene(); |
779 | m_physicsActor.Flying = isFlying; | 781 | m_physicsActor.Flying = isFlying; |
780 | SendAnimPack(); | 782 | |
783 | // Don't send an animation pack here, since on a region crossing this will sometimes cause a flying | ||
784 | // avatar to return to the standing position in mid-air. On login it looks like this is being sent | ||
785 | // elsewhere anyway | ||
786 | //SendAnimPack(); | ||
781 | 787 | ||
782 | m_scene.SwapRootAgentCount(false); | 788 | m_scene.SwapRootAgentCount(false); |
783 | m_scene.CommsManager.UserProfileCacheService.RequestInventoryForUser(m_uuid); | 789 | m_scene.CommsManager.UserProfileCacheService.RequestInventoryForUser(m_uuid); |
@@ -806,12 +812,14 @@ namespace OpenSim.Region.Environment.Scenes | |||
806 | // "[SCENEPRESENCE]: Downgrading root agent {0}, {1} to a child agent in {2}", | 812 | // "[SCENEPRESENCE]: Downgrading root agent {0}, {1} to a child agent in {2}", |
807 | // Name, UUID, m_scene.RegionInfo.RegionName); | 813 | // Name, UUID, m_scene.RegionInfo.RegionName); |
808 | 814 | ||
809 | Velocity = new Vector3(0, 0, 0); | 815 | // Don't zero out the velocity since this can cause problems when an avatar is making a region crossing, |
816 | // depending on the exact timing. This shouldn't matter anyway since child agent positions are not updated. | ||
817 | //Velocity = new Vector3(0, 0, 0); | ||
818 | |||
810 | m_isChildAgent = true; | 819 | m_isChildAgent = true; |
811 | m_scene.SwapRootAgentCount(true); | 820 | m_scene.SwapRootAgentCount(true); |
812 | RemoveFromPhysicalScene(); | 821 | RemoveFromPhysicalScene(); |
813 | m_scene.EventManager.TriggerOnMakeChildAgent(this); | 822 | m_scene.EventManager.TriggerOnMakeChildAgent(this); |
814 | //this.Pos = new Vector3(128, 128, 70); | ||
815 | } | 823 | } |
816 | 824 | ||
817 | /// <summary> | 825 | /// <summary> |
@@ -1045,11 +1053,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
1045 | bool oldflying = PhysicsActor.Flying; | 1053 | bool oldflying = PhysicsActor.Flying; |
1046 | 1054 | ||
1047 | PhysicsActor.Flying = ((flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0); | 1055 | PhysicsActor.Flying = ((flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0); |
1056 | |||
1048 | if (PhysicsActor.Flying != oldflying) | 1057 | if (PhysicsActor.Flying != oldflying) |
1049 | { | 1058 | { |
1050 | update_movementflag = true; | 1059 | update_movementflag = true; |
1051 | } | 1060 | } |
1052 | } | 1061 | } |
1062 | |||
1053 | if (q != m_bodyRot) | 1063 | if (q != m_bodyRot) |
1054 | { | 1064 | { |
1055 | m_bodyRot = q; | 1065 | m_bodyRot = q; |
@@ -1071,6 +1081,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1071 | { | 1081 | { |
1072 | // Why did I get this? | 1082 | // Why did I get this? |
1073 | } | 1083 | } |
1084 | |||
1074 | if ((m_movementflag & (uint) DCF) == 0) | 1085 | if ((m_movementflag & (uint) DCF) == 0) |
1075 | { | 1086 | { |
1076 | m_movementflag += (byte) (uint) DCF; | 1087 | m_movementflag += (byte) (uint) DCF; |
@@ -1088,6 +1099,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1088 | i++; | 1099 | i++; |
1089 | } | 1100 | } |
1090 | } | 1101 | } |
1102 | |||
1091 | // Cause the avatar to stop flying if it's colliding | 1103 | // Cause the avatar to stop flying if it's colliding |
1092 | // with something with the down arrow pressed. | 1104 | // with something with the down arrow pressed. |
1093 | 1105 | ||
@@ -1109,6 +1121,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
1109 | 1121 | ||
1110 | if (update_movementflag || (update_rotation && DCFlagKeyPressed)) | 1122 | if (update_movementflag || (update_rotation && DCFlagKeyPressed)) |
1111 | { | 1123 | { |
1124 | // m_log.DebugFormat("{0} {1}", update_movementflag, (update_rotation && DCFlagKeyPressed)); | ||
1125 | // m_log.DebugFormat( | ||
1126 | // "In {0} adding velocity to {1} of {2}", m_scene.RegionInfo.RegionName, Name, agent_control_v3); | ||
1127 | |||
1112 | AddNewMovement(agent_control_v3, q); | 1128 | AddNewMovement(agent_control_v3, q); |
1113 | 1129 | ||
1114 | if (update_movementflag) | 1130 | if (update_movementflag) |
@@ -1563,6 +1579,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
1563 | /// </summary> | 1579 | /// </summary> |
1564 | protected void TrySetMovementAnimation(string anim) | 1580 | protected void TrySetMovementAnimation(string anim) |
1565 | { | 1581 | { |
1582 | //m_log.DebugFormat("Updating movement animation to {0}", anim); | ||
1583 | |||
1566 | if (m_animations.TrySetDefaultAnimation(anim, m_controllingClient.NextAnimationSequenceNumber)) | 1584 | if (m_animations.TrySetDefaultAnimation(anim, m_controllingClient.NextAnimationSequenceNumber)) |
1567 | { | 1585 | { |
1568 | SendAnimPack(); | 1586 | SendAnimPack(); |
@@ -1638,9 +1656,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
1638 | } | 1656 | } |
1639 | } | 1657 | } |
1640 | 1658 | ||
1659 | /// <summary> | ||
1660 | /// Update the movement animation of this avatar according to its current state | ||
1661 | /// </summary> | ||
1641 | protected void UpdateMovementAnimations() | 1662 | protected void UpdateMovementAnimations() |
1642 | { | 1663 | { |
1643 | TrySetMovementAnimation(GetMovementAnimation()); | 1664 | string animation = GetMovementAnimation(); |
1665 | TrySetMovementAnimation(animation); | ||
1644 | } | 1666 | } |
1645 | 1667 | ||
1646 | /// <summary> | 1668 | /// <summary> |
@@ -2040,6 +2062,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
2040 | /// </summary> | 2062 | /// </summary> |
2041 | public void SendAnimPack() | 2063 | public void SendAnimPack() |
2042 | { | 2064 | { |
2065 | //m_log.Debug("Sending animation pack"); | ||
2066 | |||
2043 | if (m_isChildAgent) | 2067 | if (m_isChildAgent) |
2044 | return; | 2068 | return; |
2045 | 2069 | ||