diff options
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/ScenePresence.cs | 10 | ||||
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 68 |
2 files changed, 71 insertions, 7 deletions
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 69bf05a..48f3ef0 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -458,7 +458,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
458 | + (((float)m_visualParams[125] / 255.0f) / 1.5f); | 458 | + (((float)m_visualParams[125] / 255.0f) / 1.5f); |
459 | if (PhysicsActor != null) | 459 | if (PhysicsActor != null) |
460 | { | 460 | { |
461 | PhysicsVector SetSize = new PhysicsVector(0, 0, m_avHeight); | 461 | PhysicsVector SetSize = new PhysicsVector(0.45f, 0.6f, m_avHeight); |
462 | PhysicsActor.Size = SetSize; | 462 | PhysicsActor.Size = SetSize; |
463 | } | 463 | } |
464 | //OpenSim.Framework.Console.MainLog.Instance.Verbose("CLIENT", "Set Avatar Height to: " + (1.50856f + (((float)m_visualParams[25] / 255.0f) * (2.525506f - 1.50856f))).ToString() + "m" + " Leglength: " + ((float)m_visualParams[125]).ToString() + ":" + (((float)m_visualParams[125] / 255.0f)).ToString() + "m"); | 464 | //OpenSim.Framework.Console.MainLog.Instance.Verbose("CLIENT", "Set Avatar Height to: " + (1.50856f + (((float)m_visualParams[25] / 255.0f) * (2.525506f - 1.50856f))).ToString() + "m" + " Leglength: " + ((float)m_visualParams[125]).ToString() + ":" + (((float)m_visualParams[125] / 255.0f)).ToString() + "m"); |
@@ -681,11 +681,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
681 | } | 681 | } |
682 | else | 682 | else |
683 | { | 683 | { |
684 | if (!PhysicsActor.IsColliding && m_physicsActor.Velocity.Z > 6) | 684 | if (!PhysicsActor.IsColliding && m_physicsActor.Velocity.Z < -6) |
685 | { | 685 | { |
686 | SendAnimPack(Animations.AnimsLLUUID["FALLDOWN"], 1); | 686 | SendAnimPack(Animations.AnimsLLUUID["FALLDOWN"], 1); |
687 | } | 687 | } |
688 | else if (!PhysicsActor.IsColliding && Velocity.Z > 0) | 688 | else if (!PhysicsActor.IsColliding && Velocity.Z > 0 && (m_movementflag & (uint) MainAvatar.ControlFlags.AGENT_CONTROL_UP_POS) != 0) |
689 | { | 689 | { |
690 | SendAnimPack(Animations.AnimsLLUUID["JUMP"], 1); | 690 | SendAnimPack(Animations.AnimsLLUUID["JUMP"], 1); |
691 | } | 691 | } |
@@ -716,11 +716,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
716 | } | 716 | } |
717 | else | 717 | else |
718 | { | 718 | { |
719 | if (!PhysicsActor.IsColliding && m_physicsActor.Velocity.Z > 6 && !m_physicsActor.Flying) | 719 | if (!PhysicsActor.IsColliding && m_physicsActor.Velocity.Z < -6 && !m_physicsActor.Flying) |
720 | { | 720 | { |
721 | SendAnimPack(Animations.AnimsLLUUID["FALLDOWN"], 1); | 721 | SendAnimPack(Animations.AnimsLLUUID["FALLDOWN"], 1); |
722 | } | 722 | } |
723 | else if (!PhysicsActor.IsColliding && Velocity.Z > 0 && !m_physicsActor.Flying) | 723 | else if (!PhysicsActor.IsColliding && Velocity.Z > 0 && !m_physicsActor.Flying && (m_movementflag & (uint) MainAvatar.ControlFlags.AGENT_CONTROL_UP_POS) != 0) |
724 | { | 724 | { |
725 | SendAnimPack(Animations.AnimsLLUUID["JUMP"], 1); | 725 | SendAnimPack(Animations.AnimsLLUUID["JUMP"], 1); |
726 | } | 726 | } |
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index a397467..7eca7ed 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | |||
@@ -659,11 +659,17 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
659 | public float CAPSULE_LENGTH = 0.79f; | 659 | public float CAPSULE_LENGTH = 0.79f; |
660 | private bool flying = false; | 660 | private bool flying = false; |
661 | private bool m_iscolliding = false; | 661 | private bool m_iscolliding = false; |
662 | private bool m_iscollidingGround = false; | ||
662 | private bool m_wascolliding = false; | 663 | private bool m_wascolliding = false; |
664 | private bool m_wascollidingGround = false; | ||
663 | private bool m_alwaysRun = false; | 665 | private bool m_alwaysRun = false; |
666 | private bool m_hackSentFall = false; | ||
667 | private bool m_hackSentFly = false; | ||
664 | private string m_name = ""; | 668 | private string m_name = ""; |
665 | 669 | ||
666 | private bool[] m_colliderarr = new bool[11]; | 670 | private bool[] m_colliderarr = new bool[11]; |
671 | private bool[] m_colliderGroundarr = new bool[11]; | ||
672 | |||
667 | 673 | ||
668 | private bool jumping = false; | 674 | private bool jumping = false; |
669 | //private float gravityAccel; | 675 | //private float gravityAccel; |
@@ -775,8 +781,50 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
775 | } | 781 | } |
776 | public override bool CollidingGround | 782 | public override bool CollidingGround |
777 | { | 783 | { |
778 | get { return false; } | 784 | get { return m_iscollidingGround; } |
779 | set { return; } | 785 | set |
786 | { | ||
787 | int i; | ||
788 | int truecount = 0; | ||
789 | int falsecount = 0; | ||
790 | |||
791 | if (m_colliderGroundarr.Length >= 10) | ||
792 | { | ||
793 | for (i = 0; i < 10; i++) | ||
794 | { | ||
795 | m_colliderGroundarr[i] = m_colliderGroundarr[i + 1]; | ||
796 | } | ||
797 | } | ||
798 | m_colliderGroundarr[10] = value; | ||
799 | |||
800 | for (i = 0; i < 11; i++) | ||
801 | { | ||
802 | if (m_colliderGroundarr[i]) | ||
803 | { | ||
804 | truecount++; | ||
805 | } | ||
806 | else | ||
807 | { | ||
808 | falsecount++; | ||
809 | } | ||
810 | } | ||
811 | |||
812 | // Equal truecounts and false counts means we're colliding with something. | ||
813 | |||
814 | if (falsecount > 1.2 * truecount) | ||
815 | { | ||
816 | m_iscollidingGround = false; | ||
817 | } | ||
818 | else | ||
819 | { | ||
820 | m_iscollidingGround = true; | ||
821 | } | ||
822 | if (m_wascollidingGround != m_iscollidingGround) | ||
823 | { | ||
824 | //base.SendCollisionUpdate(new CollisionEventUpdate()); | ||
825 | } | ||
826 | m_wascollidingGround = m_iscollidingGround; | ||
827 | } | ||
780 | } | 828 | } |
781 | public override bool CollidingObj | 829 | public override bool CollidingObj |
782 | { | 830 | { |
@@ -1017,7 +1065,23 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1017 | vec = d.BodyGetLinearVel(Body); | 1065 | vec = d.BodyGetLinearVel(Body); |
1018 | _velocity.X = (vec.X); | 1066 | _velocity.X = (vec.X); |
1019 | _velocity.Y = (vec.Y); | 1067 | _velocity.Y = (vec.Y); |
1068 | |||
1020 | _velocity.Z = (vec.Z); | 1069 | _velocity.Z = (vec.Z); |
1070 | if (_velocity.Z < -6 && !m_hackSentFall) | ||
1071 | { | ||
1072 | m_hackSentFall = true; | ||
1073 | base.SendCollisionUpdate(new CollisionEventUpdate()); | ||
1074 | } | ||
1075 | else if (flying && !m_hackSentFly) | ||
1076 | { | ||
1077 | //m_hackSentFly = true; | ||
1078 | //base.SendCollisionUpdate(new CollisionEventUpdate()); | ||
1079 | } | ||
1080 | else | ||
1081 | { | ||
1082 | m_hackSentFly = false; | ||
1083 | m_hackSentFall = false; | ||
1084 | } | ||
1021 | } | 1085 | } |
1022 | } | 1086 | } |
1023 | 1087 | ||