aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/CoalescedSceneObjects.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-04-13 21:48:16 +0100
committerJustin Clark-Casey (justincc)2011-04-13 21:48:16 +0100
commit68cc5b46fefdf4db68cae1202086257ce731f8a1 (patch)
treec7e805586da1aa2b0125db4142cde303a8565cfe /OpenSim/Region/Framework/Scenes/CoalescedSceneObjects.cs
parentFix bug where rezzing coalesced objects would give all objects the same name ... (diff)
downloadopensim-SC-68cc5b46fefdf4db68cae1202086257ce731f8a1.zip
opensim-SC-68cc5b46fefdf4db68cae1202086257ce731f8a1.tar.gz
opensim-SC-68cc5b46fefdf4db68cae1202086257ce731f8a1.tar.bz2
opensim-SC-68cc5b46fefdf4db68cae1202086257ce731f8a1.tar.xz
refactor: move code to obtain the coalescence size and object offsets into CoalescedSceneObjects from the serializer.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/CoalescedSceneObjects.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/CoalescedSceneObjects.cs26
1 files changed, 26 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/CoalescedSceneObjects.cs b/OpenSim/Region/Framework/Scenes/CoalescedSceneObjects.cs
index 51eac5f..af8ccda 100644
--- a/OpenSim/Region/Framework/Scenes/CoalescedSceneObjects.cs
+++ b/OpenSim/Region/Framework/Scenes/CoalescedSceneObjects.cs
@@ -124,5 +124,31 @@ namespace OpenSim.Region.Framework.Scenes
124 lock (m_memberObjects) 124 lock (m_memberObjects)
125 return m_memberObjects.Remove(obj); 125 return m_memberObjects.Remove(obj);
126 } 126 }
127
128 /// <summary>
129 /// Get the total size of the coalescence (the size required to cover all the objects within it) and the
130 /// offsets of each of those objects.
131 /// </summary>
132 /// <param name="size"></param>
133 /// <returns>
134 /// An array of offsets. The order of objects is the same as returned from the Objects property
135 /// </returns>
136 public Vector3[] GetSizeAndOffsets(out Vector3 size)
137 {
138 float minX, minY, minZ;
139 float maxX, maxY, maxZ;
140
141 Vector3[] offsets
142 = Scene.GetCombinedBoundingBox(
143 Objects, out minX, out maxX, out minY, out maxY, out minZ, out maxZ);
144
145 float sizeX = maxX - minX;
146 float sizeY = maxY - minY;
147 float sizeZ = maxZ - minZ;
148
149 size = new Vector3(sizeX, sizeY, sizeZ);
150
151 return offsets;
152 }
127 } 153 }
128} \ No newline at end of file 154} \ No newline at end of file