diff options
author | diva | 2009-01-03 02:29:49 +0000 |
---|---|---|
committer | diva | 2009-01-03 02:29:49 +0000 |
commit | 4144fd0eb2ea93b9bb83b7ab81780fd00c999c82 (patch) | |
tree | 601fbe1847eda7cfa828ac0532175af6ea040bc3 /OpenSim/Region/Environment/Scenes/ScenePresence.cs | |
parent | Plumb in dwell in a couple of places (diff) | |
download | opensim-SC_OLD-4144fd0eb2ea93b9bb83b7ab81780fd00c999c82.zip opensim-SC_OLD-4144fd0eb2ea93b9bb83b7ab81780fd00c999c82.tar.gz opensim-SC_OLD-4144fd0eb2ea93b9bb83b7ab81780fd00c999c82.tar.bz2 opensim-SC_OLD-4144fd0eb2ea93b9bb83b7ab81780fd00c999c82.tar.xz |
Split agent updates into two messages: full update and position+camera update. They're both sent over HTTP PUT. The full update is sent on TPs, for now; later it will also be sent on region crossings.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/ScenePresence.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/ScenePresence.cs | 107 |
1 files changed, 78 insertions, 29 deletions
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs index 205d5cc..073457b 100644 --- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs +++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs | |||
@@ -2338,10 +2338,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
2338 | cadu.throttles = ControllingClient.GetThrottlesPacked(multiplier); | 2338 | cadu.throttles = ControllingClient.GetThrottlesPacked(multiplier); |
2339 | cadu.Velocity = new sLLVector3(Velocity); | 2339 | cadu.Velocity = new sLLVector3(Velocity); |
2340 | 2340 | ||
2341 | AgentData agent = new AgentData(); | 2341 | AgentPosition agentpos = new AgentPosition(); |
2342 | agent.CopyFrom(cadu); | 2342 | agentpos.CopyFrom(cadu); |
2343 | 2343 | ||
2344 | m_scene.SendOutChildAgentUpdates(agent, this); | 2344 | m_scene.SendOutChildAgentUpdates(agentpos, this); |
2345 | 2345 | ||
2346 | m_LastChildAgentUpdatePosition.X = AbsolutePosition.X; | 2346 | m_LastChildAgentUpdatePosition.X = AbsolutePosition.X; |
2347 | m_LastChildAgentUpdatePosition.Y = AbsolutePosition.Y; | 2347 | m_LastChildAgentUpdatePosition.Y = AbsolutePosition.Y; |
@@ -2583,17 +2583,27 @@ namespace OpenSim.Region.Environment.Scenes | |||
2583 | } | 2583 | } |
2584 | 2584 | ||
2585 | #region Child Agent Updates | 2585 | #region Child Agent Updates |
2586 | |||
2587 | public void ChildAgentDataUpdate(AgentData cAgentData) | ||
2588 | { | ||
2589 | //Console.WriteLine(" >>> ChildAgentDataUpdate <<< " + Scene.RegionInfo.RegionName); | ||
2590 | if (!IsChildAgent) | ||
2591 | return; | ||
2592 | |||
2593 | CopyFrom(cAgentData); | ||
2594 | } | ||
2595 | |||
2586 | /// <summary> | 2596 | /// <summary> |
2587 | /// This updates important decision making data about a child agent | 2597 | /// This updates important decision making data about a child agent |
2588 | /// The main purpose is to figure out what objects to send to a child agent that's in a neighboring region | 2598 | /// The main purpose is to figure out what objects to send to a child agent that's in a neighboring region |
2589 | /// </summary> | 2599 | /// </summary> |
2590 | public void ChildAgentDataUpdate(AgentData cAgentData, uint tRegionX, uint tRegionY, uint rRegionX, uint rRegionY) | 2600 | public void ChildAgentDataUpdate(AgentPosition cAgentData, uint tRegionX, uint tRegionY, uint rRegionX, uint rRegionY) |
2591 | { | 2601 | { |
2592 | // | 2602 | // |
2593 | if (!IsChildAgent) | 2603 | if (!IsChildAgent) |
2594 | return; | 2604 | return; |
2595 | 2605 | ||
2596 | //Console.WriteLine(" >>> ChildAgentDataUpdate <<< " + rRegionX + "-" + rRegionY); | 2606 | //Console.WriteLine(" >>> ChildAgentPositionUpdate <<< " + rRegionX + "-" + rRegionY); |
2597 | int shiftx = ((int)rRegionX - (int)tRegionX) * (int)Constants.RegionSize; | 2607 | int shiftx = ((int)rRegionX - (int)tRegionX) * (int)Constants.RegionSize; |
2598 | int shifty = ((int)rRegionY - (int)tRegionY) * (int)Constants.RegionSize; | 2608 | int shifty = ((int)rRegionY - (int)tRegionY) * (int)Constants.RegionSize; |
2599 | 2609 | ||
@@ -2602,33 +2612,19 @@ namespace OpenSim.Region.Environment.Scenes | |||
2602 | m_pos = new Vector3(cAgentData.Position.X + shiftx, cAgentData.Position.Y + shifty, cAgentData.Position.Z); | 2612 | m_pos = new Vector3(cAgentData.Position.X + shiftx, cAgentData.Position.Y + shifty, cAgentData.Position.Z); |
2603 | 2613 | ||
2604 | // It's hard to say here.. We can't really tell where the camera position is unless it's in world cordinates from the sending region | 2614 | // It's hard to say here.. We can't really tell where the camera position is unless it's in world cordinates from the sending region |
2605 | if (cAgentData.Center!= new Vector3(-1, -1, -1)) // UGH! | 2615 | m_CameraCenter = cAgentData.Center; |
2606 | m_CameraCenter = cAgentData.Center; | ||
2607 | // new Vector3(cAgentData.cameraPosition.x, cAgentData.cameraPosition.y, cAgentData.cameraPosition.z); | ||
2608 | |||
2609 | 2616 | ||
2610 | m_godlevel = cAgentData.GodLevel; | 2617 | m_avHeight = cAgentData.Size.Z; |
2611 | if (cAgentData.Center != new Vector3(-1, -1, -1)) | ||
2612 | m_avHeight = cAgentData.Size.Z; | ||
2613 | //SetHeight(cAgentData.AVHeight); | 2618 | //SetHeight(cAgentData.AVHeight); |
2614 | 2619 | ||
2615 | if ((cAgentData.Throttles != null) && cAgentData.Throttles.Length > 0) | 2620 | if ((cAgentData.Throttles != null) && cAgentData.Throttles.Length > 0) |
2616 | ControllingClient.SetChildAgentThrottle(cAgentData.Throttles); | 2621 | ControllingClient.SetChildAgentThrottle(cAgentData.Throttles); |
2617 | 2622 | ||
2618 | // ugh!!! | ||
2619 | m_AgentControlFlags = cAgentData.ControlFlags; | ||
2620 | if (m_physicsActor != null) | ||
2621 | { | ||
2622 | m_physicsActor.Flying = ((m_AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0); | ||
2623 | } | ||
2624 | 2623 | ||
2625 | // Sends out the objects in the user's draw distance if m_sendTasksToChild is true. | 2624 | // Sends out the objects in the user's draw distance if m_sendTasksToChild is true. |
2626 | if (m_scene.m_seeIntoRegionFromNeighbor) | 2625 | if (m_scene.m_seeIntoRegionFromNeighbor) |
2627 | m_pendingObjects = null; | 2626 | m_pendingObjects = null; |
2628 | 2627 | ||
2629 | m_callbackURI = cAgentData.CallbackURI; | ||
2630 | m_rootRegionHandle = Util.UIntsToLong(rRegionX * Constants.RegionSize, rRegionY * Constants.RegionSize); | ||
2631 | |||
2632 | //cAgentData.AVHeight; | 2628 | //cAgentData.AVHeight; |
2633 | //cAgentData.regionHandle; | 2629 | //cAgentData.regionHandle; |
2634 | //m_velocity = cAgentData.Velocity; | 2630 | //m_velocity = cAgentData.Velocity; |
@@ -2638,13 +2634,17 @@ namespace OpenSim.Region.Environment.Scenes | |||
2638 | { | 2634 | { |
2639 | cAgent.AgentID = UUID; | 2635 | cAgent.AgentID = UUID; |
2640 | cAgent.RegionHandle = m_scene.RegionInfo.RegionHandle; | 2636 | cAgent.RegionHandle = m_scene.RegionInfo.RegionHandle; |
2641 | cAgent.AlwaysRun = m_setAlwaysRun; | 2637 | |
2642 | cAgent.Size = new Vector3(0, 0, m_avHeight); | 2638 | cAgent.Position = m_pos; |
2639 | cAgent.Velocity = m_velocity; | ||
2643 | cAgent.Center = m_CameraCenter; | 2640 | cAgent.Center = m_CameraCenter; |
2641 | cAgent.Size = new Vector3(0, 0, m_avHeight); | ||
2642 | cAgent.AtAxis = m_CameraAtAxis; | ||
2643 | cAgent.LeftAxis = m_CameraLeftAxis; | ||
2644 | cAgent.UpAxis = m_CameraUpAxis; | ||
2645 | |||
2644 | cAgent.Far = m_DrawDistance; | 2646 | cAgent.Far = m_DrawDistance; |
2645 | cAgent.GodLevel = (byte)m_godlevel; | 2647 | |
2646 | cAgent.Position = AbsolutePosition; | ||
2647 | cAgent.Velocity = Velocity; | ||
2648 | // Throttles | 2648 | // Throttles |
2649 | float multiplier = 1; | 2649 | float multiplier = 1; |
2650 | int innacurateNeighbors = m_scene.GetInaccurateNeighborCount(); | 2650 | int innacurateNeighbors = m_scene.GetInaccurateNeighborCount(); |
@@ -2659,15 +2659,64 @@ namespace OpenSim.Region.Environment.Scenes | |||
2659 | //m_log.Info("[NeighborThrottle]: " + m_scene.GetInaccurateNeighborCount().ToString() + " - m: " + multiplier.ToString()); | 2659 | //m_log.Info("[NeighborThrottle]: " + m_scene.GetInaccurateNeighborCount().ToString() + " - m: " + multiplier.ToString()); |
2660 | cAgent.Throttles = ControllingClient.GetThrottlesPacked(multiplier); | 2660 | cAgent.Throttles = ControllingClient.GetThrottlesPacked(multiplier); |
2661 | 2661 | ||
2662 | cAgent.HeadRotation = m_headrotation; | ||
2663 | cAgent.BodyRotation = m_bodyRot; | ||
2664 | cAgent.ControlFlags = m_AgentControlFlags; | ||
2662 | if ((m_physicsActor != null) && (m_physicsActor.Flying)) | 2665 | if ((m_physicsActor != null) && (m_physicsActor.Flying)) |
2663 | { | 2666 | { |
2664 | m_AgentControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY; | 2667 | cAgent.ControlFlags |= (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY; |
2665 | } | 2668 | } |
2666 | cAgent.ControlFlags = m_AgentControlFlags; | ||
2667 | 2669 | ||
2670 | |||
2671 | cAgent.GodLevel = (byte)m_godlevel; | ||
2672 | cAgent.AlwaysRun = m_setAlwaysRun; | ||
2673 | |||
2674 | //cAgent.AgentTextures = ??? | ||
2675 | //cAgent.GroupID = ?? | ||
2668 | // Groups??? | 2676 | // Groups??? |
2669 | // Visual Params??? | 2677 | |
2678 | // Animations??? | ||
2679 | |||
2680 | cAgent.VisualParams = m_appearance.VisualParams; | ||
2681 | } | ||
2682 | |||
2683 | public void CopyFrom(AgentData cAgent) | ||
2684 | { | ||
2685 | m_rootRegionHandle= cAgent.RegionHandle; | ||
2686 | m_callbackURI = cAgent.CallbackURI; | ||
2687 | |||
2688 | m_pos = cAgent.Position; | ||
2689 | m_velocity = cAgent.Velocity; | ||
2690 | m_CameraCenter = cAgent.Center; | ||
2691 | m_avHeight = cAgent.Size.Z; | ||
2692 | m_CameraAtAxis = cAgent.AtAxis; | ||
2693 | m_CameraLeftAxis = cAgent.LeftAxis; | ||
2694 | m_CameraUpAxis = cAgent.UpAxis; | ||
2695 | |||
2696 | m_DrawDistance = cAgent.Far; | ||
2697 | |||
2698 | if ((cAgent.Throttles != null) && cAgent.Throttles.Length > 0) | ||
2699 | ControllingClient.SetChildAgentThrottle(cAgent.Throttles); | ||
2700 | |||
2701 | m_headrotation = cAgent.HeadRotation; | ||
2702 | m_bodyRot = cAgent.BodyRotation; | ||
2703 | m_AgentControlFlags = cAgent.ControlFlags; // We need more flags! | ||
2704 | if (m_physicsActor != null) | ||
2705 | { | ||
2706 | m_physicsActor.Flying = ((m_AgentControlFlags & (uint)AgentManager.ControlFlags.AGENT_CONTROL_FLY) != 0); | ||
2707 | } | ||
2708 | |||
2709 | m_godlevel = cAgent.GodLevel; | ||
2710 | m_setAlwaysRun = cAgent.AlwaysRun; | ||
2711 | |||
2712 | //cAgent.AgentTextures = ??? | ||
2713 | |||
2714 | //cAgent.GroupID = ?? | ||
2715 | //Groups??? | ||
2716 | |||
2670 | // Animations??? | 2717 | // Animations??? |
2718 | |||
2719 | m_appearance.VisualParams = cAgent.VisualParams; | ||
2671 | } | 2720 | } |
2672 | 2721 | ||
2673 | #endregion Child Agent Updates | 2722 | #endregion Child Agent Updates |