diff options
author | Revolution | 2010-02-14 15:41:57 -0600 |
---|---|---|
committer | Melanie | 2010-02-14 22:18:46 +0000 |
commit | 9821c4f566e11c75c8d87721777480c5b2e2bd4e (patch) | |
tree | 04cf7edb4cfe07e1f50ce3ee0ca5d846e6a7a379 /OpenSim/Region/Framework/Scenes/ScenePresence.cs | |
parent | * SQLite match code casing with regionsettings table field casing (what's wit... (diff) | |
download | opensim-SC-9821c4f566e11c75c8d87721777480c5b2e2bd4e.zip opensim-SC-9821c4f566e11c75c8d87721777480c5b2e2bd4e.tar.gz opensim-SC-9821c4f566e11c75c8d87721777480c5b2e2bd4e.tar.bz2 opensim-SC-9821c4f566e11c75c8d87721777480c5b2e2bd4e.tar.xz |
Revolution is on the roll again! :)
Fixes: Undo, T-pose of others on login, modifiedBulletX works again, feet now stand on the ground instead of in the ground, adds checks to CombatModule. Adds: Redo, Land Undo, checks to agentUpdate (so one can not fall off of a region), more vehicle parts. Finishes almost all of LSL (1 function left, 2 events).
Direct flames and kudos to Revolution, please
Signed-off-by: Melanie <melanie@t-data.com>
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/ScenePresence.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/ScenePresence.cs | 89 |
1 files changed, 83 insertions, 6 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs index 9c7559b..675fb69 100644 --- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs | |||
@@ -164,6 +164,8 @@ namespace OpenSim.Region.Framework.Scenes | |||
164 | 164 | ||
165 | private Quaternion m_bodyRot= Quaternion.Identity; | 165 | private Quaternion m_bodyRot= Quaternion.Identity; |
166 | 166 | ||
167 | private Quaternion m_bodyRotPrevious = Quaternion.Identity; | ||
168 | |||
167 | private const int LAND_VELOCITYMAG_MAX = 12; | 169 | private const int LAND_VELOCITYMAG_MAX = 12; |
168 | 170 | ||
169 | public bool IsRestrictedToRegion; | 171 | public bool IsRestrictedToRegion; |
@@ -508,6 +510,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
508 | set { m_bodyRot = value; } | 510 | set { m_bodyRot = value; } |
509 | } | 511 | } |
510 | 512 | ||
513 | public Quaternion PreviousRotation | ||
514 | { | ||
515 | get { return m_bodyRotPrevious; } | ||
516 | set { m_bodyRotPrevious = value; } | ||
517 | } | ||
518 | |||
511 | /// <summary> | 519 | /// <summary> |
512 | /// If this is true, agent doesn't have a representation in this scene. | 520 | /// If this is true, agent doesn't have a representation in this scene. |
513 | /// this is an agent 'looking into' this scene from a nearby scene(region) | 521 | /// this is an agent 'looking into' this scene from a nearby scene(region) |
@@ -824,6 +832,31 @@ namespace OpenSim.Region.Framework.Scenes | |||
824 | if (pos.X < 0 || pos.Y < 0 || pos.Z < 0) | 832 | if (pos.X < 0 || pos.Y < 0 || pos.Z < 0) |
825 | { | 833 | { |
826 | Vector3 emergencyPos = new Vector3(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), 128); | 834 | Vector3 emergencyPos = new Vector3(((int)Constants.RegionSize * 0.5f), ((int)Constants.RegionSize * 0.5f), 128); |
835 | |||
836 | if (pos.X < 0) | ||
837 | { | ||
838 | emergencyPos.X = (int)Constants.RegionSize + pos.X; | ||
839 | if (!(pos.Y < 0)) | ||
840 | emergencyPos.Y = pos.Y; | ||
841 | if (!(pos.Z < 0)) | ||
842 | emergencyPos.X = pos.X; | ||
843 | } | ||
844 | if (pos.Y < 0) | ||
845 | { | ||
846 | emergencyPos.Y = (int)Constants.RegionSize + pos.Y; | ||
847 | if (!(pos.X < 0)) | ||
848 | emergencyPos.X = pos.X; | ||
849 | if (!(pos.Z < 0)) | ||
850 | emergencyPos.Z = pos.Z; | ||
851 | } | ||
852 | if (pos.Z < 0) | ||
853 | { | ||
854 | if (!(pos.X < 0)) | ||
855 | emergencyPos.X = pos.X; | ||
856 | if (!(pos.Y < 0)) | ||
857 | emergencyPos.Y = pos.Y; | ||
858 | //Leave as 128 | ||
859 | } | ||
827 | 860 | ||
828 | m_log.WarnFormat( | 861 | m_log.WarnFormat( |
829 | "[SCENE PRESENCE]: MakeRootAgent() was given an illegal position of {0} for avatar {1}, {2}. Substituting {3}", | 862 | "[SCENE PRESENCE]: MakeRootAgent() was given an illegal position of {0} for avatar {1}, {2}. Substituting {3}", |
@@ -1193,6 +1226,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
1193 | } | 1226 | } |
1194 | else | 1227 | else |
1195 | { | 1228 | { |
1229 | if (m_pos.X < 0) | ||
1230 | m_pos.X = 128; | ||
1231 | if (m_pos.Y < 0) | ||
1232 | m_pos.Y = 128; | ||
1233 | if (m_pos.X > Scene.WestBorders[0].BorderLine.X) | ||
1234 | m_pos.X = 128; | ||
1235 | if (m_pos.Y > Scene.NorthBorders[0].BorderLine.Y) | ||
1236 | m_pos.Y = 128; | ||
1196 | m_LastFinitePos = m_pos; | 1237 | m_LastFinitePos = m_pos; |
1197 | } | 1238 | } |
1198 | 1239 | ||
@@ -2704,36 +2745,72 @@ namespace OpenSim.Region.Framework.Scenes | |||
2704 | { | 2745 | { |
2705 | // Checks if where it's headed exists a region | 2746 | // Checks if where it's headed exists a region |
2706 | 2747 | ||
2748 | bool needsTransit = false; | ||
2707 | if (m_scene.TestBorderCross(pos2, Cardinals.W)) | 2749 | if (m_scene.TestBorderCross(pos2, Cardinals.W)) |
2708 | { | 2750 | { |
2709 | if (m_scene.TestBorderCross(pos2, Cardinals.S)) | 2751 | if (m_scene.TestBorderCross(pos2, Cardinals.S)) |
2752 | { | ||
2753 | needsTransit = true; | ||
2710 | neighbor = HaveNeighbor(Cardinals.SW, ref fix); | 2754 | neighbor = HaveNeighbor(Cardinals.SW, ref fix); |
2755 | } | ||
2711 | else if (m_scene.TestBorderCross(pos2, Cardinals.N)) | 2756 | else if (m_scene.TestBorderCross(pos2, Cardinals.N)) |
2757 | { | ||
2758 | needsTransit = true; | ||
2712 | neighbor = HaveNeighbor(Cardinals.NW, ref fix); | 2759 | neighbor = HaveNeighbor(Cardinals.NW, ref fix); |
2760 | } | ||
2713 | else | 2761 | else |
2762 | { | ||
2763 | needsTransit = true; | ||
2714 | neighbor = HaveNeighbor(Cardinals.W, ref fix); | 2764 | neighbor = HaveNeighbor(Cardinals.W, ref fix); |
2765 | } | ||
2715 | } | 2766 | } |
2716 | else if (m_scene.TestBorderCross(pos2, Cardinals.E)) | 2767 | else if (m_scene.TestBorderCross(pos2, Cardinals.E)) |
2717 | { | 2768 | { |
2718 | if (m_scene.TestBorderCross(pos2, Cardinals.S)) | 2769 | if (m_scene.TestBorderCross(pos2, Cardinals.S)) |
2770 | { | ||
2771 | needsTransit = true; | ||
2719 | neighbor = HaveNeighbor(Cardinals.SE, ref fix); | 2772 | neighbor = HaveNeighbor(Cardinals.SE, ref fix); |
2773 | } | ||
2720 | else if (m_scene.TestBorderCross(pos2, Cardinals.N)) | 2774 | else if (m_scene.TestBorderCross(pos2, Cardinals.N)) |
2775 | { | ||
2776 | needsTransit = true; | ||
2721 | neighbor = HaveNeighbor(Cardinals.NE, ref fix); | 2777 | neighbor = HaveNeighbor(Cardinals.NE, ref fix); |
2778 | } | ||
2722 | else | 2779 | else |
2780 | { | ||
2781 | needsTransit = true; | ||
2723 | neighbor = HaveNeighbor(Cardinals.E, ref fix); | 2782 | neighbor = HaveNeighbor(Cardinals.E, ref fix); |
2783 | } | ||
2724 | } | 2784 | } |
2725 | else if (m_scene.TestBorderCross(pos2, Cardinals.S)) | 2785 | else if (m_scene.TestBorderCross(pos2, Cardinals.S)) |
2786 | { | ||
2787 | needsTransit = true; | ||
2726 | neighbor = HaveNeighbor(Cardinals.S, ref fix); | 2788 | neighbor = HaveNeighbor(Cardinals.S, ref fix); |
2789 | } | ||
2727 | else if (m_scene.TestBorderCross(pos2, Cardinals.N)) | 2790 | else if (m_scene.TestBorderCross(pos2, Cardinals.N)) |
2791 | { | ||
2792 | needsTransit = true; | ||
2728 | neighbor = HaveNeighbor(Cardinals.N, ref fix); | 2793 | neighbor = HaveNeighbor(Cardinals.N, ref fix); |
2794 | } | ||
2795 | |||
2729 | 2796 | ||
2730 | |||
2731 | // Makes sure avatar does not end up outside region | 2797 | // Makes sure avatar does not end up outside region |
2732 | if (neighbor < 0) | 2798 | if (neighbor <= 0) |
2733 | AbsolutePosition = new Vector3( | 2799 | { |
2734 | AbsolutePosition.X + 3*fix[0], | 2800 | if (!needsTransit) |
2735 | AbsolutePosition.Y + 3*fix[1], | 2801 | { |
2736 | AbsolutePosition.Z); | 2802 | Vector3 pos = AbsolutePosition; |
2803 | if (AbsolutePosition.X < 0) | ||
2804 | pos.X += Velocity.Y; | ||
2805 | else if (AbsolutePosition.X > Constants.RegionSize) | ||
2806 | pos.X -= Velocity.Y; | ||
2807 | if (AbsolutePosition.Y < 0) | ||
2808 | pos.Y += Velocity.Y; | ||
2809 | else if (AbsolutePosition.Y > Constants.RegionSize) | ||
2810 | pos.Y -= Velocity.Y; | ||
2811 | AbsolutePosition = pos; | ||
2812 | } | ||
2813 | } | ||
2737 | else if (neighbor > 0) | 2814 | else if (neighbor > 0) |
2738 | CrossToNewRegion(); | 2815 | CrossToNewRegion(); |
2739 | } | 2816 | } |