aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes')
-rw-r--r--OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs2
-rw-r--r--OpenSim/Region/Environment/Scenes/Scene.cs16
-rw-r--r--OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs8
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs107
4 files changed, 97 insertions, 36 deletions
diff --git a/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs
index abf4065..5e1621b 100644
--- a/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs
+++ b/OpenSim/Region/Environment/Scenes/Hypergrid/HGSceneCommunicationService.cs
@@ -260,7 +260,7 @@ namespace OpenSim.Region.Environment.Scenes.Hypergrid
260 // Let's send a full update of the agent. This is a synchronous call. 260 // Let's send a full update of the agent. This is a synchronous call.
261 AgentData agent = new AgentData(); 261 AgentData agent = new AgentData();
262 avatar.CopyTo(agent); 262 avatar.CopyTo(agent);
263 agent.Position = new Vector3(-1, -1, -1); // this means ignore position info; UGH!!!! 263 agent.Position = position;
264 agent.CallbackURI = "http://" + m_regionInfo.ExternalHostName + ":" + m_regionInfo.HttpPort + 264 agent.CallbackURI = "http://" + m_regionInfo.ExternalHostName + ":" + m_regionInfo.HttpPort +
265 "/agent/" + avatar.UUID.ToString() + "/" + avatar.Scene.RegionInfo.RegionHandle.ToString() + "/release/"; 265 "/agent/" + avatar.UUID.ToString() + "/" + avatar.Scene.RegionInfo.RegionHandle.ToString() + "/release/";
266 266
diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs
index f652e21..408f100 100644
--- a/OpenSim/Region/Environment/Scenes/Scene.cs
+++ b/OpenSim/Region/Environment/Scenes/Scene.cs
@@ -2970,7 +2970,19 @@ namespace OpenSim.Region.Environment.Scenes
2970 2970
2971 public virtual bool IncomingChildAgentDataUpdate(AgentData cAgentData) 2971 public virtual bool IncomingChildAgentDataUpdate(AgentData cAgentData)
2972 { 2972 {
2973 //Console.WriteLine(" XXX Scene IncomingChildAgentDataUpdate in " + RegionInfo.RegionName); 2973 //Console.WriteLine(" XXX Scene IncomingChildAgentDataUpdate FULL in " + RegionInfo.RegionName);
2974 ScenePresence childAgentUpdate = GetScenePresence(cAgentData.AgentID);
2975 if (childAgentUpdate != null)
2976 {
2977 childAgentUpdate.ChildAgentDataUpdate(cAgentData);
2978 return true;
2979 }
2980 return false;
2981 }
2982
2983 public virtual bool IncomingChildAgentDataUpdate(AgentPosition cAgentData)
2984 {
2985 //Console.WriteLine(" XXX Scene IncomingChildAgentDataUpdate POSITION in " + RegionInfo.RegionName);
2974 ScenePresence childAgentUpdate = GetScenePresence(cAgentData.AgentID); 2986 ScenePresence childAgentUpdate = GetScenePresence(cAgentData.AgentID);
2975 if (childAgentUpdate != null) 2987 if (childAgentUpdate != null)
2976 { 2988 {
@@ -3174,7 +3186,7 @@ namespace OpenSim.Region.Environment.Scenes
3174 return m_sceneGridService.CrossToNeighbouringRegion(regionHandle, agentID, position, isFlying); 3186 return m_sceneGridService.CrossToNeighbouringRegion(regionHandle, agentID, position, isFlying);
3175 } 3187 }
3176 3188
3177 public void SendOutChildAgentUpdates(AgentData cadu, ScenePresence presence) 3189 public void SendOutChildAgentUpdates(AgentPosition cadu, ScenePresence presence)
3178 { 3190 {
3179 m_sceneGridService.SendChildAgentDataUpdate(cadu, presence); 3191 m_sceneGridService.SendChildAgentDataUpdate(cadu, presence);
3180 } 3192 }
diff --git a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
index da3a9d3..8b3ac4f 100644
--- a/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
+++ b/OpenSim/Region/Environment/Scenes/SceneCommunicationService.cs
@@ -538,7 +538,7 @@ namespace OpenSim.Region.Environment.Scenes
538 //bool val = m_commsProvider.InterRegion.RegionUp(new SerializableRegionInfo(region)); 538 //bool val = m_commsProvider.InterRegion.RegionUp(new SerializableRegionInfo(region));
539 } 539 }
540 540
541 public delegate void SendChildAgentDataUpdateDelegate(AgentData cAgentData, ulong regionHandle); 541 public delegate void SendChildAgentDataUpdateDelegate(AgentPosition cAgentData, ulong regionHandle);
542 542
543 /// <summary> 543 /// <summary>
544 /// This informs all neighboring regions about the settings of it's child agent. 544 /// This informs all neighboring regions about the settings of it's child agent.
@@ -547,7 +547,7 @@ namespace OpenSim.Region.Environment.Scenes
547 /// This contains information, such as, Draw Distance, Camera location, Current Position, Current throttle settings, etc. 547 /// This contains information, such as, Draw Distance, Camera location, Current Position, Current throttle settings, etc.
548 /// 548 ///
549 /// </summary> 549 /// </summary>
550 private void SendChildAgentDataUpdateAsync(AgentData cAgentData, ulong regionHandle) 550 private void SendChildAgentDataUpdateAsync(AgentPosition cAgentData, ulong regionHandle)
551 { 551 {
552 //m_log.Info("[INTERGRID]: Informing neighbors about my agent in " + m_regionInfo.RegionName); 552 //m_log.Info("[INTERGRID]: Informing neighbors about my agent in " + m_regionInfo.RegionName);
553 try 553 try
@@ -577,7 +577,7 @@ namespace OpenSim.Region.Environment.Scenes
577 icon.EndInvoke(iar); 577 icon.EndInvoke(iar);
578 } 578 }
579 579
580 public void SendChildAgentDataUpdate(AgentData cAgentData, ScenePresence presence) 580 public void SendChildAgentDataUpdate(AgentPosition cAgentData, ScenePresence presence)
581 { 581 {
582 // This assumes that we know what our neighbors are. 582 // This assumes that we know what our neighbors are.
583 try 583 try
@@ -847,7 +847,7 @@ namespace OpenSim.Region.Environment.Scenes
847 // Let's send a full update of the agent. This is a synchronous call. 847 // Let's send a full update of the agent. This is a synchronous call.
848 AgentData agent = new AgentData(); 848 AgentData agent = new AgentData();
849 avatar.CopyTo(agent); 849 avatar.CopyTo(agent);
850 agent.Position = new Vector3(-1, -1, -1); // this means ignore position info; UGH!!!! 850 agent.Position = position;
851 agent.CallbackURI = "http://" + m_regionInfo.ExternalHostName + ":" + m_regionInfo.HttpPort + 851 agent.CallbackURI = "http://" + m_regionInfo.ExternalHostName + ":" + m_regionInfo.HttpPort +
852 "/agent/" + avatar.UUID.ToString() + "/" + avatar.Scene.RegionInfo.RegionHandle.ToString() + "/release/"; 852 "/agent/" + avatar.UUID.ToString() + "/" + avatar.Scene.RegionInfo.RegionHandle.ToString() + "/release/";
853 853
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