diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 933999e..22248af 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -5236,5 +5236,49 @@ namespace OpenSim.Region.Framework.Scenes | |||
5236 | ReloadEstateData(); | 5236 | ReloadEstateData(); |
5237 | } | 5237 | } |
5238 | } | 5238 | } |
5239 | |||
5240 | public Vector3[] GetCombinedBoundingBox(List<SceneObjectGroup> objects, out float minX, out float maxX, out float minY, out float maxY, out float minZ, out float maxZ) | ||
5241 | { | ||
5242 | minX = 256; | ||
5243 | maxX = -256; | ||
5244 | minY = 256; | ||
5245 | maxY = -256; | ||
5246 | minZ = 8192; | ||
5247 | maxZ = -256; | ||
5248 | |||
5249 | List<Vector3> offsets = new List<Vector3>(); | ||
5250 | |||
5251 | foreach (SceneObjectGroup g in objects) | ||
5252 | { | ||
5253 | float ominX, ominY, ominZ, omaxX, omaxY, omaxZ; | ||
5254 | |||
5255 | g.GetAxisAlignedBoundingBoxRaw(out ominX, out omaxX, out ominY, out omaxY, out ominZ, out omaxZ); | ||
5256 | |||
5257 | if (minX > ominX) | ||
5258 | minX = ominX; | ||
5259 | if (minY > ominY) | ||
5260 | minY = ominY; | ||
5261 | if (minZ > ominZ) | ||
5262 | minZ = ominZ; | ||
5263 | if (maxX < omaxX) | ||
5264 | maxX = omaxX; | ||
5265 | if (maxY < omaxY) | ||
5266 | maxY = omaxY; | ||
5267 | if (maxZ < omaxZ) | ||
5268 | maxZ = omaxZ; | ||
5269 | } | ||
5270 | |||
5271 | foreach (SceneObjectGroup g in objects) | ||
5272 | { | ||
5273 | Vector3 vec = g.AbsolutePosition; | ||
5274 | vec.X -= minX; | ||
5275 | vec.Y -= minY; | ||
5276 | vec.Z -= minZ; | ||
5277 | |||
5278 | offsets.Add(vec); | ||
5279 | } | ||
5280 | |||
5281 | return offsets.ToArray(); | ||
5282 | } | ||
5239 | } | 5283 | } |
5240 | } | 5284 | } |