Split GetAxisAlignedBoundingBox into two methods to allow calculation of

combined bounding boxes and offsets
soprefactor
Melanie Thielker 2010-06-01 01:07:46 +02:00 committed by Melanie
parent be69259981
commit 2fce7d9bcf
1 changed files with 20 additions and 3 deletions

View File

@ -652,10 +652,16 @@ namespace OpenSim.Region.Framework.Scenes
/// offsetHeight is the offset in the Z axis from the centre of the bounding box to the centre of the root prim /// offsetHeight is the offset in the Z axis from the centre of the bounding box to the centre of the root prim
/// </summary> /// </summary>
/// <returns></returns> /// <returns></returns>
public Vector3 GetAxisAlignedBoundingBox(out float offsetHeight) public void GetAxisAlignedBoundingBoxRaw(out float minX, out float maxX, out float minY, out float maxY, out float minZ, out float maxZ)
{ {
float maxX = -256f, maxY = -256f, maxZ = -256f, minX = 256f, minY = 256f, minZ = 256f; maxX = -256f;
lock (m_parts) maxY = -256f;
maxZ = -256f;
minX = 256f;
minY = 256f;
minZ = 256f;
lock(m_parts);
{ {
foreach (SceneObjectPart part in m_parts.Values) foreach (SceneObjectPart part in m_parts.Values)
{ {
@ -888,7 +894,18 @@ namespace OpenSim.Region.Framework.Scenes
minZ = backBottomLeft.Z; minZ = backBottomLeft.Z;
} }
} }
}
public Vector3 GetAxisAlignedBoundingBox(out float offsetHeight)
{
float minX;
float maxX;
float minY;
float maxY;
float minZ;
float maxZ;
GetAxisAlignedBoundingBoxRaw(out minX, out maxX, out minY, out maxY, out minZ, out maxZ);
Vector3 boundingBox = new Vector3(maxX - minX, maxY - minY, maxZ - minZ); Vector3 boundingBox = new Vector3(maxX - minX, maxY - minY, maxZ - minZ);
offsetHeight = 0; offsetHeight = 0;