diff options
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/ScenePresence.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/ScenePresence.cs | 46 |
1 files changed, 43 insertions, 3 deletions
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index ab19973..5d643d1 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -52,6 +52,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
52 | private uint m_requestedSitTargetID = 0; | 52 | private uint m_requestedSitTargetID = 0; |
53 | private LLVector3 m_requestedSitOffset = new LLVector3(); | 53 | private LLVector3 m_requestedSitOffset = new LLVector3(); |
54 | private float m_sitAvatarHeight = 2.0f; | 54 | private float m_sitAvatarHeight = 2.0f; |
55 | private bool m_oldColliding = true; | ||
55 | 56 | ||
56 | private bool m_isTyping = false; | 57 | private bool m_isTyping = false; |
57 | 58 | ||
@@ -388,6 +389,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
388 | { | 389 | { |
389 | m_scene.PhysScene.RemoveAvatar(PhysicsActor); | 390 | m_scene.PhysScene.RemoveAvatar(PhysicsActor); |
390 | m_physicsActor.OnRequestTerseUpdate -= SendTerseUpdateToAllClients; | 391 | m_physicsActor.OnRequestTerseUpdate -= SendTerseUpdateToAllClients; |
392 | m_physicsActor.OnCollisionUpdate -= PhysicsCollisionUpdate; | ||
391 | PhysicsActor = null; | 393 | PhysicsActor = null; |
392 | } | 394 | } |
393 | } | 395 | } |
@@ -407,6 +409,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
407 | /// </summary> | 409 | /// </summary> |
408 | public void StopMovement() | 410 | public void StopMovement() |
409 | { | 411 | { |
412 | int x = 0; | ||
410 | } | 413 | } |
411 | 414 | ||
412 | public void AddNeighbourRegion(ulong regionHandle) | 415 | public void AddNeighbourRegion(ulong regionHandle) |
@@ -489,7 +492,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
489 | // Console.WriteLine("DEBUG: HandleAgentUpdate: null PhysicsActor!"); | 492 | // Console.WriteLine("DEBUG: HandleAgentUpdate: null PhysicsActor!"); |
490 | return; | 493 | return; |
491 | } | 494 | } |
492 | 495 | ||
493 | int i = 0; | 496 | int i = 0; |
494 | bool update_movementflag = false; | 497 | bool update_movementflag = false; |
495 | bool update_rotation = false; | 498 | bool update_rotation = false; |
@@ -497,6 +500,8 @@ namespace OpenSim.Region.Environment.Scenes | |||
497 | Vector3 agent_control_v3 = new Vector3(0, 0, 0); | 500 | Vector3 agent_control_v3 = new Vector3(0, 0, 0); |
498 | Quaternion q = new Quaternion(bodyRotation.W, bodyRotation.X, bodyRotation.Y, bodyRotation.Z); | 501 | Quaternion q = new Quaternion(bodyRotation.W, bodyRotation.X, bodyRotation.Y, bodyRotation.Z); |
499 | bool oldflying = PhysicsActor.Flying; | 502 | bool oldflying = PhysicsActor.Flying; |
503 | |||
504 | |||
500 | PhysicsActor.Flying = ((flags & (uint) MainAvatar.ControlFlags.AGENT_CONTROL_FLY) != 0); | 505 | PhysicsActor.Flying = ((flags & (uint) MainAvatar.ControlFlags.AGENT_CONTROL_FLY) != 0); |
501 | if (PhysicsActor.Flying != oldflying) | 506 | if (PhysicsActor.Flying != oldflying) |
502 | { | 507 | { |
@@ -652,7 +657,18 @@ namespace OpenSim.Region.Environment.Scenes | |||
652 | } | 657 | } |
653 | else | 658 | else |
654 | { | 659 | { |
655 | SendAnimPack(Animations.AnimsLLUUID["WALK"], 1); | 660 | if (!PhysicsActor.IsColliding && m_physicsActor.Velocity.Z > 6) |
661 | { | ||
662 | SendAnimPack(Animations.AnimsLLUUID["FALLDOWN"], 1); | ||
663 | } | ||
664 | else if (!PhysicsActor.IsColliding && Velocity.Z > 0) | ||
665 | { | ||
666 | SendAnimPack(Animations.AnimsLLUUID["JUMP"], 1); | ||
667 | } | ||
668 | else | ||
669 | { | ||
670 | SendAnimPack(Animations.AnimsLLUUID["WALK"], 1); | ||
671 | } | ||
656 | } | 672 | } |
657 | } | 673 | } |
658 | } | 674 | } |
@@ -669,7 +685,22 @@ namespace OpenSim.Region.Environment.Scenes | |||
669 | } | 685 | } |
670 | else | 686 | else |
671 | { | 687 | { |
672 | SendAnimPack(Animations.AnimsLLUUID["STAND"], 1); | 688 | if (!PhysicsActor.IsColliding && m_physicsActor.Velocity.Z > 6 && !m_physicsActor.Flying) |
689 | { | ||
690 | SendAnimPack(Animations.AnimsLLUUID["FALLDOWN"], 1); | ||
691 | } | ||
692 | else if (!PhysicsActor.IsColliding && Velocity.Z > 0 && !m_physicsActor.Flying) | ||
693 | { | ||
694 | SendAnimPack(Animations.AnimsLLUUID["JUMP"], 1); | ||
695 | } | ||
696 | else | ||
697 | { | ||
698 | if (!m_physicsActor.Flying) | ||
699 | { | ||
700 | SendAnimPack(Animations.AnimsLLUUID["STAND"], 1); | ||
701 | } | ||
702 | } | ||
703 | |||
673 | } | 704 | } |
674 | } | 705 | } |
675 | } | 706 | } |
@@ -702,6 +733,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
702 | direc.z *= 3; | 733 | direc.z *= 3; |
703 | //System.Console.WriteLine("Jump"); | 734 | //System.Console.WriteLine("Jump"); |
704 | SendAnimPack(Animations.AnimsLLUUID["PRE_JUMP"], 1); | 735 | SendAnimPack(Animations.AnimsLLUUID["PRE_JUMP"], 1); |
736 | SendAnimPack(Animations.AnimsLLUUID["JUMP"], 1); | ||
705 | } | 737 | } |
706 | } | 738 | } |
707 | } | 739 | } |
@@ -1115,8 +1147,16 @@ namespace OpenSim.Region.Environment.Scenes | |||
1115 | 1147 | ||
1116 | m_physicsActor = scene.AddAvatar(Firstname + "." + Lastname, pVec); | 1148 | m_physicsActor = scene.AddAvatar(Firstname + "." + Lastname, pVec); |
1117 | m_physicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients; | 1149 | m_physicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients; |
1150 | m_physicsActor.OnCollisionUpdate += PhysicsCollisionUpdate; | ||
1118 | } | 1151 | } |
1152 | private void PhysicsCollisionUpdate(EventArgs e) | ||
1153 | { | ||
1154 | bool isUserMoving = false; | ||
1155 | if (Velocity.X > 0 || Velocity.Y > 0) | ||
1156 | isUserMoving = true; | ||
1157 | UpdateMovementAnimations(isUserMoving); | ||
1119 | 1158 | ||
1159 | } | ||
1120 | internal void Close() | 1160 | internal void Close() |
1121 | { | 1161 | { |
1122 | RemoveFromPhysicalScene(); | 1162 | RemoveFromPhysicalScene(); |