aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/ScenePresence.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/ScenePresence.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/ScenePresence.cs58
1 files changed, 55 insertions, 3 deletions
diff --git a/OpenSim/Region/Environment/Scenes/ScenePresence.cs b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
index c8310e4..f37b38b 100644
--- a/OpenSim/Region/Environment/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Environment/Scenes/ScenePresence.cs
@@ -55,6 +55,7 @@ namespace OpenSim.Region.Environment.Scenes
55 private LLVector3 m_requestedSitOffset = new LLVector3(); 55 private LLVector3 m_requestedSitOffset = new LLVector3();
56 private float m_sitAvatarHeight = 2.0f; 56 private float m_sitAvatarHeight = 2.0f;
57 private float m_godlevel = 0; 57 private float m_godlevel = 0;
58 private LLVector3 m_LastChildAgentUpdatePosition = new LLVector3();
58 59
59 private int m_perfMonMS = 0; 60 private int m_perfMonMS = 0;
60 61
@@ -90,6 +91,8 @@ namespace OpenSim.Region.Environment.Scenes
90 private LLQuaternion m_headrotation = new LLQuaternion(); 91 private LLQuaternion m_headrotation = new LLQuaternion();
91 private byte m_state = (byte) 0; 92 private byte m_state = (byte) 0;
92 93
94 private List<LLUUID> m_knownPrimUUID = new List<LLUUID>();
95
93 // Agent's Draw distance. 96 // Agent's Draw distance.
94 protected float m_DrawDistance = 0f; 97 protected float m_DrawDistance = 0f;
95 98
@@ -136,6 +139,17 @@ namespace OpenSim.Region.Environment.Scenes
136 get { return m_physicsActor; } 139 get { return m_physicsActor; }
137 } 140 }
138 141
142 public bool KnownPrim(LLUUID primID)
143 {
144 if (m_knownPrimUUID.Contains(primID))
145 {
146 return true;
147 }
148 m_knownPrimUUID.Add(primID);
149 return false;
150 }
151
152
139 public bool Updated 153 public bool Updated
140 { 154 {
141 set { m_updateflag = value; } 155 set { m_updateflag = value; }
@@ -499,7 +513,7 @@ namespace OpenSim.Region.Environment.Scenes
499 m_scene.CommsManager.UserProfileCacheService.UpdateUserInventory(m_uuid); 513 m_scene.CommsManager.UserProfileCacheService.UpdateUserInventory(m_uuid);
500 //if (!m_gotAllObjectsInScene) 514 //if (!m_gotAllObjectsInScene)
501 //{ 515 //{
502 //m_scene.SendAllSceneObjectsToClient(this); 516 m_scene.SendAllSceneObjectsToClient(this);
503 //m_gotAllObjectsInScene = true; 517 //m_gotAllObjectsInScene = true;
504 //} 518 //}
505 } 519 }
@@ -1408,6 +1422,29 @@ namespace OpenSim.Region.Environment.Scenes
1408 m_scene.NotifyMyCoarseLocationChange(); 1422 m_scene.NotifyMyCoarseLocationChange();
1409 } 1423 }
1410 } 1424 }
1425
1426 // Minimum Draw distance is 64 meters, the Radius of the draw distance sphere is 32m
1427 if (Util.GetDistanceTo(AbsolutePosition,m_LastChildAgentUpdatePosition) > 32)
1428 {
1429 ChildAgentDataUpdate cadu = new ChildAgentDataUpdate();
1430 cadu.ActiveGroupID=LLUUID.Zero.UUID;
1431 cadu.AgentID = UUID.UUID;
1432 cadu.alwaysrun = m_setAlwaysRun;
1433 cadu.AVHeight = m_avHeight;
1434 LLVector3 tempCameraCenter = new LLVector3(m_CameraCenter.x, m_CameraCenter.y, m_CameraCenter.z);
1435 cadu.cameraPosition = new sLLVector3(tempCameraCenter);
1436 cadu.drawdistance = m_DrawDistance;
1437 cadu.godlevel = m_godlevel;
1438 cadu.GroupAccess = 0;
1439 cadu.Position = new sLLVector3(AbsolutePosition);
1440 cadu.regionHandle = m_scene.RegionInfo.RegionHandle;
1441 cadu.throttles = ControllingClient.GetThrottlesPacked(1f);
1442 cadu.Velocity = new sLLVector3(Velocity);
1443 m_scene.SendOutChildAgentUpdates(cadu,this);
1444 m_LastChildAgentUpdatePosition.X = AbsolutePosition.X;
1445 m_LastChildAgentUpdatePosition.Y = AbsolutePosition.Y;
1446 m_LastChildAgentUpdatePosition.Z = AbsolutePosition.Z;
1447 }
1411 } 1448 }
1412 1449
1413 #endregion 1450 #endregion
@@ -1532,15 +1569,30 @@ namespace OpenSim.Region.Environment.Scenes
1532 /// This updates important decision making data about a child agent 1569 /// This updates important decision making data about a child agent
1533 /// The main purpose is to figure out what objects to send to a child agent that's in a neighboring region 1570 /// The main purpose is to figure out what objects to send to a child agent that's in a neighboring region
1534 /// </summary> 1571 /// </summary>
1535 public void ChildAgentDataUpdate(ChildAgentDataUpdate cAgentData) 1572 public void ChildAgentDataUpdate(ChildAgentDataUpdate cAgentData, uint tRegionX, uint tRegionY, uint rRegionX, uint rRegionY)
1536 { 1573 {
1537 // 1574 //
1575 int shiftx = ((int)rRegionX - (int)tRegionX) * 256;
1576 int shifty = ((int)rRegionY - (int)tRegionY) * 256;
1577
1538 m_DrawDistance = cAgentData.drawdistance; 1578 m_DrawDistance = cAgentData.drawdistance;
1539 m_pos = new LLVector3(cAgentData.Position.x, cAgentData.Position.y, cAgentData.Position.z); 1579 m_pos = new LLVector3(cAgentData.Position.x + shiftx, cAgentData.Position.y + shifty, cAgentData.Position.z);
1580
1581 // 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
1540 m_CameraCenter = 1582 m_CameraCenter =
1541 new Vector3(cAgentData.cameraPosition.x, cAgentData.cameraPosition.y, cAgentData.cameraPosition.z); 1583 new Vector3(cAgentData.cameraPosition.x, cAgentData.cameraPosition.y, cAgentData.cameraPosition.z);
1584
1585
1542 m_godlevel = cAgentData.godlevel; 1586 m_godlevel = cAgentData.godlevel;
1587 SetHeight(cAgentData.AVHeight);
1588
1543 ControllingClient.SetChildAgentThrottle(cAgentData.throttles); 1589 ControllingClient.SetChildAgentThrottle(cAgentData.throttles);
1590
1591
1592
1593 // Sends out the objects in the user's draw distance if m_sendTasksToChild is true.
1594 if (m_scene.m_sendTasksToChild)
1595 m_scene.SendAllSceneObjectsToClient(this);
1544 //cAgentData.AVHeight; 1596 //cAgentData.AVHeight;
1545 //cAgentData.regionHandle; 1597 //cAgentData.regionHandle;
1546 //m_velocity = cAgentData.Velocity; 1598 //m_velocity = cAgentData.Velocity;