diff options
author | Teravus Ovares | 2007-12-10 21:12:38 +0000 |
---|---|---|
committer | Teravus Ovares | 2007-12-10 21:12:38 +0000 |
commit | 2349dc2e27becef11ca1eda2602a99f1a583e6f7 (patch) | |
tree | fe31e46ac53d8fdaf4679f483c3d8bf06e5cb48d /OpenSim/Region/Environment/Scenes/ScenePresence.cs | |
parent | * More refactoring to prepare for draw distance based agent sim notification. (diff) | |
download | opensim-SC_OLD-2349dc2e27becef11ca1eda2602a99f1a583e6f7.zip opensim-SC_OLD-2349dc2e27becef11ca1eda2602a99f1a583e6f7.tar.gz opensim-SC_OLD-2349dc2e27becef11ca1eda2602a99f1a583e6f7.tar.bz2 opensim-SC_OLD-2349dc2e27becef11ca1eda2602a99f1a583e6f7.tar.xz |
* Added comments to many methods in the listed files.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/ScenePresence.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/ScenePresence.cs | 146 |
1 files changed, 105 insertions, 41 deletions
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index c277011..201a547 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -61,10 +61,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
61 | 61 | ||
62 | public bool IsRestrictedToRegion = false; | 62 | public bool IsRestrictedToRegion = false; |
63 | 63 | ||
64 | // Agent moves with a PID controller causing a force to be exerted. | ||
64 | private bool m_newForce = false; | 65 | private bool m_newForce = false; |
65 | private bool m_newAvatar = false; | 66 | private bool m_newAvatar = false; |
66 | private bool m_newCoarseLocations = true; | 67 | private bool m_newCoarseLocations = true; |
67 | private bool m_gotAllObjectsInScene = false; | 68 | private bool m_gotAllObjectsInScene = false; |
69 | |||
70 | // Default AV Height | ||
68 | private float m_avHeight = 127.0f; | 71 | private float m_avHeight = 127.0f; |
69 | 72 | ||
70 | protected RegionInfo m_regionInfo; | 73 | protected RegionInfo m_regionInfo; |
@@ -73,7 +76,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
73 | private readonly Vector3[] Dir_Vectors = new Vector3[6]; | 76 | private readonly Vector3[] Dir_Vectors = new Vector3[6]; |
74 | private LLVector3 lastPhysPos = new LLVector3(); | 77 | private LLVector3 lastPhysPos = new LLVector3(); |
75 | 78 | ||
76 | // Position of agent's camera in world | 79 | // Position of agent's camera in world (region cordinates) |
77 | protected Vector3 m_CameraCenter = new Vector3(0, 0, 0); | 80 | protected Vector3 m_CameraCenter = new Vector3(0, 0, 0); |
78 | 81 | ||
79 | // Use these three vectors to figure out what the agent is looking at | 82 | // Use these three vectors to figure out what the agent is looking at |
@@ -88,7 +91,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
88 | protected AvatarAppearance m_appearance; | 91 | protected AvatarAppearance m_appearance; |
89 | 92 | ||
90 | private readonly List<ulong> m_knownChildRegions = new List<ulong>(); //neighbouring regions we have enabled a child agent in | 93 | private readonly List<ulong> m_knownChildRegions = new List<ulong>(); //neighbouring regions we have enabled a child agent in |
94 | |||
91 | 95 | ||
96 | /// <summary> | ||
97 | /// Implemented Control Flags | ||
98 | /// </summary> | ||
92 | private enum Dir_ControlFlags | 99 | private enum Dir_ControlFlags |
93 | { | 100 | { |
94 | DIR_CONTROL_FLAG_FOWARD = AgentManager.ControlFlags.AGENT_CONTROL_AT_POS, | 101 | DIR_CONTROL_FLAG_FOWARD = AgentManager.ControlFlags.AGENT_CONTROL_AT_POS, |
@@ -114,7 +121,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
114 | #region Properties | 121 | #region Properties |
115 | 122 | ||
116 | /// <summary> | 123 | /// <summary> |
117 | /// | 124 | /// Physical scene representation of this Avatar. |
118 | /// </summary> | 125 | /// </summary> |
119 | public PhysicsActor PhysicsActor | 126 | public PhysicsActor PhysicsActor |
120 | { | 127 | { |
@@ -166,6 +173,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
166 | set { m_allowMovement = value; } | 173 | set { m_allowMovement = value; } |
167 | } | 174 | } |
168 | 175 | ||
176 | /// <summary> | ||
177 | /// This works out to be the ClientView object associated with this avatar, or it's UDP connection manager | ||
178 | /// </summary> | ||
179 | |||
169 | private readonly IClientAPI m_controllingClient; | 180 | private readonly IClientAPI m_controllingClient; |
170 | protected PhysicsActor m_physicsActor; | 181 | protected PhysicsActor m_physicsActor; |
171 | 182 | ||
@@ -176,6 +187,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
176 | 187 | ||
177 | protected LLVector3 m_parentPosition = new LLVector3(); | 188 | protected LLVector3 m_parentPosition = new LLVector3(); |
178 | 189 | ||
190 | /// <summary> | ||
191 | /// Absolute position of this avatar in 'region cordinates' | ||
192 | /// </summary> | ||
179 | public override LLVector3 AbsolutePosition | 193 | public override LLVector3 AbsolutePosition |
180 | { | 194 | { |
181 | get | 195 | get |
@@ -209,7 +223,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
209 | m_pos = value; | 223 | m_pos = value; |
210 | } | 224 | } |
211 | } | 225 | } |
212 | 226 | /// <summary> | |
227 | /// Current Velocity of the avatar. | ||
228 | /// </summary> | ||
213 | public override LLVector3 Velocity | 229 | public override LLVector3 Velocity |
214 | { | 230 | { |
215 | get | 231 | get |
@@ -244,6 +260,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
244 | } | 260 | } |
245 | } | 261 | } |
246 | 262 | ||
263 | /// <summary> | ||
264 | /// If this is true, agent doesn't have a representation in this scene. | ||
265 | /// this is an agent 'looking into' this scene from a nearby scene(region) | ||
266 | /// | ||
267 | /// if False, this agent has a representation in this scene | ||
268 | /// </summary> | ||
247 | private bool m_isChildAgent = true; | 269 | private bool m_isChildAgent = true; |
248 | 270 | ||
249 | public bool IsChildAgent | 271 | public bool IsChildAgent |
@@ -260,6 +282,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
260 | set { m_parentID = value; } | 282 | set { m_parentID = value; } |
261 | } | 283 | } |
262 | 284 | ||
285 | /// <summary> | ||
286 | /// These are the region handles known by the avatar. | ||
287 | /// </summary> | ||
263 | public List<ulong> KnownChildRegions | 288 | public List<ulong> KnownChildRegions |
264 | { | 289 | { |
265 | get { return m_knownChildRegions; } | 290 | get { return m_knownChildRegions; } |
@@ -461,7 +486,11 @@ namespace OpenSim.Region.Environment.Scenes | |||
461 | } | 486 | } |
462 | 487 | ||
463 | #region Status Methods | 488 | #region Status Methods |
464 | 489 | /// <summary> | |
490 | /// This turns a child agent, into a root agent | ||
491 | /// This is called when an agent teleports into a region, or if an | ||
492 | /// agent crosses into this region from a neighbor over the border | ||
493 | /// </summary> | ||
465 | public void MakeRootAgent(LLVector3 pos, bool isFlying) | 494 | public void MakeRootAgent(LLVector3 pos, bool isFlying) |
466 | { | 495 | { |
467 | 496 | ||
@@ -481,7 +510,13 @@ namespace OpenSim.Region.Environment.Scenes | |||
481 | //} | 510 | //} |
482 | 511 | ||
483 | } | 512 | } |
484 | 513 | /// <summary> | |
514 | /// This turns a root agent into a child agent | ||
515 | /// when an agent departs this region for a neighbor, this gets called. | ||
516 | /// | ||
517 | /// It doesn't get called for a teleport. Reason being, an agent that | ||
518 | /// teleports out may not be anywhere near this region | ||
519 | /// </summary> | ||
485 | public void MakeChildAgent() | 520 | public void MakeChildAgent() |
486 | { | 521 | { |
487 | Velocity = new LLVector3(0, 0, 0); | 522 | Velocity = new LLVector3(0, 0, 0); |
@@ -492,6 +527,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
492 | //this.Pos = new LLVector3(128, 128, 70); | 527 | //this.Pos = new LLVector3(128, 128, 70); |
493 | } | 528 | } |
494 | 529 | ||
530 | /// <summary> | ||
531 | /// Removes physics plugin scene representation of this agent if it exists. | ||
532 | /// </summary> | ||
495 | private void RemoveFromPhysicalScene() | 533 | private void RemoveFromPhysicalScene() |
496 | { | 534 | { |
497 | if (PhysicsActor != null) | 535 | if (PhysicsActor != null) |
@@ -538,7 +576,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
538 | #endregion | 576 | #endregion |
539 | 577 | ||
540 | #region Event Handlers | 578 | #region Event Handlers |
541 | 579 | /// <summary> | |
580 | /// Sets avatar height in the phyiscs plugin | ||
581 | /// </summary> | ||
542 | internal void SetHeight(float height) | 582 | internal void SetHeight(float height) |
543 | { | 583 | { |
544 | m_avHeight = height; | 584 | m_avHeight = height; |
@@ -570,7 +610,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
570 | MakeRootAgent(AbsolutePosition, false); | 610 | MakeRootAgent(AbsolutePosition, false); |
571 | } | 611 | } |
572 | } | 612 | } |
573 | 613 | /// <summary> | |
614 | /// This is the event handler for client movement. If a client is moving, this event is triggering. | ||
615 | /// </summary> | ||
574 | public void HandleAgentUpdate(IClientAPI remoteClient, AgentUpdatePacket agentData) | 616 | public void HandleAgentUpdate(IClientAPI remoteClient, AgentUpdatePacket agentData) |
575 | { | 617 | { |
576 | //if (m_isChildAgent) | 618 | //if (m_isChildAgent) |
@@ -608,26 +650,6 @@ namespace OpenSim.Region.Environment.Scenes | |||
608 | // The Agent's Draw distance setting | 650 | // The Agent's Draw distance setting |
609 | m_DrawDistance = agentData.AgentData.Far; | 651 | m_DrawDistance = agentData.AgentData.Far; |
610 | 652 | ||
611 | // We don't know the agent's draw distance until the first agentUpdate packet | ||
612 | //if (m_DrawDistance > 0) | ||
613 | //{ | ||
614 | //if (!m_gotAllObjectsInScene && m_DrawDistance > 0) | ||
615 | //{ | ||
616 | // This will need to end up being a space based invalidator | ||
617 | // where we send object updates on spaces in 3d space (possibily a cube) | ||
618 | // that the avatar hasn't been surrounding it's draw distance. | ||
619 | // It would be better if the distance increased incrementally | ||
620 | // until there was no space to update because either the avatar's draw | ||
621 | // distance is smaller then the space they've been or the avatar has explored | ||
622 | // all the space in the sim. | ||
623 | |||
624 | //m_scene.SendAllSceneObjectsToClient(this); | ||
625 | //m_gotAllObjectsInScene = true; | ||
626 | //} | ||
627 | //} | ||
628 | //MainLog.Instance.Verbose("CAMERA", "AtAxis:" + m_CameraAtAxis.ToString() + " Center:" + m_CameraCenter.ToString() + " LeftAxis:" + m_CameraLeftAxis.ToString() + " UpAxis:" + m_CameraUpAxis.ToString() + " Far:" + m_CameraFar); | ||
629 | |||
630 | |||
631 | if ((flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_STAND_UP) != 0) | 653 | if ((flags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_STAND_UP) != 0) |
632 | { | 654 | { |
633 | StandUp(); | 655 | StandUp(); |
@@ -793,7 +815,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
793 | SetMovementAnimation(Animations.AnimsLLUUID["SIT"], 1); | 815 | SetMovementAnimation(Animations.AnimsLLUUID["SIT"], 1); |
794 | SendFullUpdateToAllClients(); | 816 | SendFullUpdateToAllClients(); |
795 | } | 817 | } |
796 | 818 | /// <summary> | |
819 | /// Event handler for the 'Always run' setting on the client | ||
820 | /// Tells the physics plugin to increase speed of movement. | ||
821 | /// </summary> | ||
797 | public void HandleSetAlwaysRun(IClientAPI remoteClient, bool SetAlwaysRun) | 822 | public void HandleSetAlwaysRun(IClientAPI remoteClient, bool SetAlwaysRun) |
798 | { | 823 | { |
799 | m_setAlwaysRun = SetAlwaysRun; | 824 | m_setAlwaysRun = SetAlwaysRun; |
@@ -853,13 +878,18 @@ namespace OpenSim.Region.Environment.Scenes | |||
853 | SendAnimPack(); | 878 | SendAnimPack(); |
854 | } | 879 | } |
855 | } | 880 | } |
856 | 881 | /// <summary> | |
882 | /// This method handles agent movement related animations | ||
883 | /// </summary> | ||
857 | protected void UpdateMovementAnimations(bool update_movementflag) | 884 | protected void UpdateMovementAnimations(bool update_movementflag) |
858 | { | 885 | { |
859 | if (update_movementflag) | 886 | if (update_movementflag) |
860 | { | 887 | { |
888 | // Are we moving? | ||
861 | if (m_movementflag != 0) | 889 | if (m_movementflag != 0) |
862 | { | 890 | { |
891 | // We are moving | ||
892 | // Are we flying | ||
863 | if (m_physicsActor.Flying) | 893 | if (m_physicsActor.Flying) |
864 | { | 894 | { |
865 | SetMovementAnimation(Animations.AnimsLLUUID["FLY"], 1); | 895 | SetMovementAnimation(Animations.AnimsLLUUID["FLY"], 1); |
@@ -867,18 +897,22 @@ namespace OpenSim.Region.Environment.Scenes | |||
867 | else if (((m_movementflag & (uint)AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) && | 897 | else if (((m_movementflag & (uint)AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) && |
868 | PhysicsActor.IsColliding) | 898 | PhysicsActor.IsColliding) |
869 | { | 899 | { |
900 | // Client is pressing the page down button and moving and is colliding with something | ||
870 | SetMovementAnimation(Animations.AnimsLLUUID["CROUCHWALK"], 1); | 901 | SetMovementAnimation(Animations.AnimsLLUUID["CROUCHWALK"], 1); |
871 | } | 902 | } |
872 | else if (!PhysicsActor.IsColliding && m_physicsActor.Velocity.Z < -6) | 903 | else if (!PhysicsActor.IsColliding && m_physicsActor.Velocity.Z < -6) |
873 | { | 904 | { |
905 | // Client is moving and falling at a velocity greater then 6 meters per unit | ||
874 | SetMovementAnimation(Animations.AnimsLLUUID["FALLDOWN"], 1); | 906 | SetMovementAnimation(Animations.AnimsLLUUID["FALLDOWN"], 1); |
875 | } | 907 | } |
876 | else if (!PhysicsActor.IsColliding && Velocity.Z > 0 && (m_movementflag & (uint)AgentManager.ControlFlags.AGENT_CONTROL_UP_POS) != 0) | 908 | else if (!PhysicsActor.IsColliding && Velocity.Z > 0 && (m_movementflag & (uint)AgentManager.ControlFlags.AGENT_CONTROL_UP_POS) != 0) |
877 | { | 909 | { |
910 | // client is moving, and colliding and pressing the page up button but isn't flying | ||
878 | SetMovementAnimation(Animations.AnimsLLUUID["JUMP"], 1); | 911 | SetMovementAnimation(Animations.AnimsLLUUID["JUMP"], 1); |
879 | } | 912 | } |
880 | else if (m_setAlwaysRun) | 913 | else if (m_setAlwaysRun) |
881 | { | 914 | { |
915 | // We are running | ||
882 | SetMovementAnimation(Animations.AnimsLLUUID["RUN"], 1); | 916 | SetMovementAnimation(Animations.AnimsLLUUID["RUN"], 1); |
883 | } | 917 | } |
884 | else | 918 | else |
@@ -886,29 +920,39 @@ namespace OpenSim.Region.Environment.Scenes | |||
886 | } | 920 | } |
887 | else | 921 | else |
888 | { | 922 | { |
923 | // Not moving | ||
924 | |||
889 | if (((m_movementflag & (uint)AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) && | 925 | if (((m_movementflag & (uint)AgentManager.ControlFlags.AGENT_CONTROL_UP_NEG) != 0) && |
890 | PhysicsActor.IsColliding) | 926 | PhysicsActor.IsColliding) |
891 | { | 927 | { |
928 | // Client pressing the page down button | ||
892 | SetMovementAnimation(Animations.AnimsLLUUID["CROUCH"], 1); | 929 | SetMovementAnimation(Animations.AnimsLLUUID["CROUCH"], 1); |
893 | } | 930 | } |
894 | else if (!PhysicsActor.IsColliding && m_physicsActor.Velocity.Z < -6 && !m_physicsActor.Flying) | 931 | else if (!PhysicsActor.IsColliding && m_physicsActor.Velocity.Z < -6 && !m_physicsActor.Flying) |
895 | { | 932 | { |
933 | // Not colliding, and we're not flying and we're falling at a speed of 6m per unit | ||
896 | SetMovementAnimation(Animations.AnimsLLUUID["FALLDOWN"], 1); | 934 | SetMovementAnimation(Animations.AnimsLLUUID["FALLDOWN"], 1); |
897 | } | 935 | } |
898 | else if (!PhysicsActor.IsColliding && Velocity.Z > 0 && !m_physicsActor.Flying && (m_movementflag & (uint)AgentManager.ControlFlags.AGENT_CONTROL_UP_POS) != 0) | 936 | else if (!PhysicsActor.IsColliding && Velocity.Z > 0 && !m_physicsActor.Flying && (m_movementflag & (uint)AgentManager.ControlFlags.AGENT_CONTROL_UP_POS) != 0) |
899 | { | 937 | { |
938 | // This is the standing jump | ||
900 | SetMovementAnimation(Animations.AnimsLLUUID["JUMP"], 1); | 939 | SetMovementAnimation(Animations.AnimsLLUUID["JUMP"], 1); |
901 | } | 940 | } |
902 | else if (m_physicsActor.Flying) | 941 | else if (m_physicsActor.Flying) |
903 | { | 942 | { |
943 | // This should probably be HOVER and not Fly | ||
944 | // We're not moving and flying | ||
904 | SetMovementAnimation(Animations.AnimsLLUUID["FLY"], 1); | 945 | SetMovementAnimation(Animations.AnimsLLUUID["FLY"], 1); |
905 | } | 946 | } |
906 | else | 947 | else |
907 | SetMovementAnimation(Animations.AnimsLLUUID["STAND"], 1); | 948 | SetMovementAnimation(Animations.AnimsLLUUID["STAND"], 1); |
949 | // We're not moving.. and we're not doing anything.. so play the stand animation | ||
908 | } | 950 | } |
909 | } | 951 | } |
910 | } | 952 | } |
911 | 953 | /// <summary> | |
954 | /// Adds a new movement | ||
955 | /// </summary> | ||
912 | protected void AddNewMovement(Vector3 vec, Quaternion rotation) | 956 | protected void AddNewMovement(Vector3 vec, Quaternion rotation) |
913 | { | 957 | { |
914 | if (m_isChildAgent) | 958 | if (m_isChildAgent) |
@@ -935,6 +979,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
935 | { | 979 | { |
936 | direc.z *= 3; | 980 | direc.z *= 3; |
937 | //System.Console.WriteLine("Jump"); | 981 | //System.Console.WriteLine("Jump"); |
982 | // PreJump and jump happen too quickly. Many times prejump gets ignored. | ||
938 | SetMovementAnimation(Animations.AnimsLLUUID["PREJUMP"], 1); | 983 | SetMovementAnimation(Animations.AnimsLLUUID["PREJUMP"], 1); |
939 | SetMovementAnimation(Animations.AnimsLLUUID["JUMP"], 1); | 984 | SetMovementAnimation(Animations.AnimsLLUUID["JUMP"], 1); |
940 | } | 985 | } |
@@ -946,7 +991,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
946 | newVelocity.Z = direc.z; | 991 | newVelocity.Z = direc.z; |
947 | m_forcesList.Add(newVelocity); | 992 | m_forcesList.Add(newVelocity); |
948 | } | 993 | } |
949 | 994 | /// <summary> | |
995 | /// Sets whether or not the agent is typing. | ||
996 | /// </summary> | ||
950 | public void setTyping(bool typing) | 997 | public void setTyping(bool typing) |
951 | { | 998 | { |
952 | if (m_isChildAgent) | 999 | if (m_isChildAgent) |
@@ -1010,7 +1057,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1010 | #region Update Client(s) | 1057 | #region Update Client(s) |
1011 | 1058 | ||
1012 | /// <summary> | 1059 | /// <summary> |
1013 | /// | 1060 | /// Sends a location update to the client connected to this scenePresence |
1014 | /// </summary> | 1061 | /// </summary> |
1015 | /// <param name="RemoteClient"></param> | 1062 | /// <param name="RemoteClient"></param> |
1016 | public void SendTerseUpdateToClient(IClientAPI RemoteClient) | 1063 | public void SendTerseUpdateToClient(IClientAPI RemoteClient) |
@@ -1027,7 +1074,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1027 | } | 1074 | } |
1028 | 1075 | ||
1029 | /// <summary> | 1076 | /// <summary> |
1030 | /// | 1077 | /// Send a location/velocity/accelleration update to all agents in scene |
1031 | /// </summary> | 1078 | /// </summary> |
1032 | public void SendTerseUpdateToAllClients() | 1079 | public void SendTerseUpdateToAllClients() |
1033 | { | 1080 | { |
@@ -1055,7 +1102,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1055 | } | 1102 | } |
1056 | 1103 | ||
1057 | /// <summary> | 1104 | /// <summary> |
1058 | /// | 1105 | /// Tell other client about this avatar (The client previously didn't know or had outdated details about this avatar) |
1059 | /// </summary> | 1106 | /// </summary> |
1060 | /// <param name="remoteAvatar"></param> | 1107 | /// <param name="remoteAvatar"></param> |
1061 | public void SendFullUpdateToOtherClient(ScenePresence remoteAvatar) | 1108 | public void SendFullUpdateToOtherClient(ScenePresence remoteAvatar) |
@@ -1063,7 +1110,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
1063 | remoteAvatar.m_controllingClient.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_uuid, | 1110 | remoteAvatar.m_controllingClient.SendAvatarData(m_regionInfo.RegionHandle, m_firstname, m_lastname, m_uuid, |
1064 | LocalId, m_pos, m_appearance.TextureEntry.ToBytes(), m_parentID); | 1111 | LocalId, m_pos, m_appearance.TextureEntry.ToBytes(), m_parentID); |
1065 | } | 1112 | } |
1066 | 1113 | /// <summary> | |
1114 | /// Tell *ALL* agents about this agent | ||
1115 | /// </summary> | ||
1067 | public void SendFullUpdateToAllClients() | 1116 | public void SendFullUpdateToAllClients() |
1068 | { | 1117 | { |
1069 | List<ScenePresence> avatars = m_scene.GetScenePresences(); | 1118 | List<ScenePresence> avatars = m_scene.GetScenePresences(); |
@@ -1167,7 +1216,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
1167 | #endregion | 1216 | #endregion |
1168 | 1217 | ||
1169 | #region Significant Movement Method | 1218 | #region Significant Movement Method |
1170 | 1219 | /// <summary> | |
1220 | /// This checks for a significant movement and sends a courselocationchange update | ||
1221 | /// </summary> | ||
1171 | protected void CheckForSignificantMovement() | 1222 | protected void CheckForSignificantMovement() |
1172 | { | 1223 | { |
1173 | if (Util.GetDistanceTo(AbsolutePosition, posLastSignificantMove) > 0.02) | 1224 | if (Util.GetDistanceTo(AbsolutePosition, posLastSignificantMove) > 0.02) |
@@ -1186,7 +1237,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1186 | #region Border Crossing Methods | 1237 | #region Border Crossing Methods |
1187 | 1238 | ||
1188 | /// <summary> | 1239 | /// <summary> |
1189 | /// | 1240 | /// Checks to see if the avatar is in range of a border and calls CrossToNewRegion |
1190 | /// </summary> | 1241 | /// </summary> |
1191 | protected void CheckForBorderCrossing() | 1242 | protected void CheckForBorderCrossing() |
1192 | { | 1243 | { |
@@ -1210,7 +1261,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
1210 | } | 1261 | } |
1211 | 1262 | ||
1212 | /// <summary> | 1263 | /// <summary> |
1213 | /// | 1264 | /// Moves the agent outside the region bounds |
1265 | /// Tells neighbor region that we're crossing to it | ||
1266 | /// If the neighbor accepts, remove the agent's viewable avatar from this scene | ||
1267 | /// set them to a child agent. | ||
1214 | /// </summary> | 1268 | /// </summary> |
1215 | protected void CrossToNewRegion() | 1269 | protected void CrossToNewRegion() |
1216 | { | 1270 | { |
@@ -1262,7 +1316,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
1262 | } | 1316 | } |
1263 | 1317 | ||
1264 | #endregion | 1318 | #endregion |
1265 | 1319 | /// <summary> | |
1320 | /// This allows the Sim owner the abiility to kick users from their sim currently. | ||
1321 | /// It tells the client that the agent has permission to do so. | ||
1322 | /// </summary> | ||
1266 | public void GrantGodlikePowers(LLUUID agentID, LLUUID sessionID, LLUUID token) | 1323 | public void GrantGodlikePowers(LLUUID agentID, LLUUID sessionID, LLUUID token) |
1267 | { | 1324 | { |
1268 | GrantGodlikePowersPacket respondPacket = new GrantGodlikePowersPacket(); | 1325 | GrantGodlikePowersPacket respondPacket = new GrantGodlikePowersPacket(); |
@@ -1279,6 +1336,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
1279 | respondPacket.AgentData = adb; | 1336 | respondPacket.AgentData = adb; |
1280 | ControllingClient.OutPacket(respondPacket, ThrottleOutPacketType.Task); | 1337 | ControllingClient.OutPacket(respondPacket, ThrottleOutPacketType.Task); |
1281 | } | 1338 | } |
1339 | /// <summary> | ||
1340 | /// This updates important decision making data about a child agent | ||
1341 | /// The main purpose is to figure out what objects to send to a child agent that's in a neighboring region | ||
1342 | /// </summary> | ||
1282 | public void ChildAgentDataUpdate(ChildAgentDataUpdate cAgentData) | 1343 | public void ChildAgentDataUpdate(ChildAgentDataUpdate cAgentData) |
1283 | { | 1344 | { |
1284 | // | 1345 | // |
@@ -1301,7 +1362,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1301 | } | 1362 | } |
1302 | 1363 | ||
1303 | /// <summary> | 1364 | /// <summary> |
1304 | /// | 1365 | /// handles part of the PID controller function for moving an avatar. |
1305 | /// </summary> | 1366 | /// </summary> |
1306 | public override void UpdateMovement() | 1367 | public override void UpdateMovement() |
1307 | { | 1368 | { |
@@ -1363,6 +1424,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
1363 | throw new Exception("Can't set Text on avatar."); | 1424 | throw new Exception("Can't set Text on avatar."); |
1364 | } | 1425 | } |
1365 | 1426 | ||
1427 | /// <summary> | ||
1428 | /// Adds a physical representation of the avatar to the Physics plugin | ||
1429 | /// </summary> | ||
1366 | public void AddToPhysicalScene() | 1430 | public void AddToPhysicalScene() |
1367 | { | 1431 | { |
1368 | PhysicsScene scene = m_scene.PhysicsScene; | 1432 | PhysicsScene scene = m_scene.PhysicsScene; |
@@ -1375,7 +1439,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1375 | m_physicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients; | 1439 | m_physicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients; |
1376 | m_physicsActor.OnCollisionUpdate += PhysicsCollisionUpdate; | 1440 | m_physicsActor.OnCollisionUpdate += PhysicsCollisionUpdate; |
1377 | } | 1441 | } |
1378 | 1442 | // Event called by the physics plugin to tell the avatar about a collision. | |
1379 | private void PhysicsCollisionUpdate(EventArgs e) | 1443 | private void PhysicsCollisionUpdate(EventArgs e) |
1380 | { | 1444 | { |
1381 | bool isUserMoving = Velocity.X > 0 || Velocity.Y > 0; | 1445 | bool isUserMoving = Velocity.X > 0 || Velocity.Y > 0; |