aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Environment/Scenes/InnerScene.cs
diff options
context:
space:
mode:
authorTeravus Ovares2007-11-22 01:32:13 +0000
committerTeravus Ovares2007-11-22 01:32:13 +0000
commite69c810486e63e8b4398c7b67e84d73154d2dfcf (patch)
tree21423ba1dfad709e85a52e455d2c65840bad21d2 /OpenSim/Region/Environment/Scenes/InnerScene.cs
parentFixed bug that can lead to infinitive loops (diff)
downloadopensim-SC-e69c810486e63e8b4398c7b67e84d73154d2dfcf.zip
opensim-SC-e69c810486e63e8b4398c7b67e84d73154d2dfcf.tar.gz
opensim-SC-e69c810486e63e8b4398c7b67e84d73154d2dfcf.tar.bz2
opensim-SC-e69c810486e63e8b4398c7b67e84d73154d2dfcf.tar.xz
* Added code to capture the draw distance setting from the client.
* Added a support function to InnerScene to calculate the distance between two vectors.
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/InnerScene.cs')
-rw-r--r--OpenSim/Region/Environment/Scenes/InnerScene.cs36
1 files changed, 35 insertions, 1 deletions
diff --git a/OpenSim/Region/Environment/Scenes/InnerScene.cs b/OpenSim/Region/Environment/Scenes/InnerScene.cs
index 1f3bc95..38a8a06 100644
--- a/OpenSim/Region/Environment/Scenes/InnerScene.cs
+++ b/OpenSim/Region/Environment/Scenes/InnerScene.cs
@@ -1,6 +1,7 @@
1using System; 1using System;
2using System.Collections.Generic; 2using System.Collections.Generic;
3using System.Text; 3using System.Text;
4using Axiom.Math;
4using libsecondlife; 5using libsecondlife;
5using libsecondlife.Packets; 6using libsecondlife.Packets;
6using OpenSim.Framework; 7using OpenSim.Framework;
@@ -325,7 +326,32 @@ namespace OpenSim.Region.Environment.Scenes
325 { 326 {
326 if (ent is SceneObjectGroup) 327 if (ent is SceneObjectGroup)
327 { 328 {
328 ((SceneObjectGroup)ent).ScheduleFullUpdateToAvatar(presence); 329 // Only send child agents stuff in their draw distance.
330 // This will need to be done for every agent once we figure out
331 // what we're going to use to store prim that agents already got
332 // the initial update for and what we'll use to limit the
333 // space we check for new objects on movement.
334
335 if (presence.IsChildAgent)
336 {
337 //Vector3 avPosition = new Vector3(presence.AbsolutePosition.X,presence.AbsolutePosition.Y,presence.AbsolutePosition.Z);
338 //LLVector3 oLoc = ((SceneObjectGroup)ent).AbsolutePosition;
339 //Vector3 objPosition = new Vector3(oLoc.X,oLoc.Y,oLoc.Z);
340 //float distResult = Vector3Distance(avPosition, objPosition);
341 //if (distResult > 512)
342 //{
343 //int x = 0;
344 //}
345 //if (distResult < presence.DrawDistance)
346 //{
347 ((SceneObjectGroup)ent).ScheduleFullUpdateToAvatar(presence);
348 //}
349
350 }
351 else
352 {
353 ((SceneObjectGroup)ent).ScheduleFullUpdateToAvatar(presence);
354 }
329 } 355 }
330 } 356 }
331 } 357 }
@@ -642,7 +668,15 @@ namespace OpenSim.Region.Environment.Scenes
642 } 668 }
643 669
644 } 670 }
671 public float Vector3Distance(Vector3 v1, Vector3 v2)
672 {
673 // Calculates the distance between two Vector3s
674 // We don't really need the double floating point precision...
675 // so casting it to a single
645 676
677 return (float)Math.Sqrt((v1.x - v2.x) * (v1.x - v2.x) + (v1.y - v2.y) * (v1.y - v2.y) + (v1.z - v2.z) * (v1.z - v2.z));
678
679 }
646 #endregion 680 #endregion
647 } 681 }
648} 682}