From df2a59d31b1ae21f99c1b18976b8d799b935a762 Mon Sep 17 00:00:00 2001
From: Justin Clark-Casey (justincc)
Date: Sat, 16 Jul 2011 03:30:14 +0100
Subject: refactor: make SceneObjectGroup.GroupScale() a property rather than a
mehod
---
.../Caps/ObjectCaps/UploadObjectAssetModule.cs | 10 ++--
.../Region/Framework/Scenes/SceneObjectGroup.cs | 61 ++++++++++++----------
2 files changed, 38 insertions(+), 33 deletions(-)
diff --git a/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs b/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs
index 15ed3b3..8189518 100644
--- a/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs
+++ b/OpenSim/Region/ClientStack/Linden/Caps/ObjectCaps/UploadObjectAssetModule.cs
@@ -129,7 +129,7 @@ namespace OpenSim.Region.ClientStack.Linden
///
- /// Parses ad request
+ /// Parses add request
///
///
///
@@ -312,11 +312,11 @@ namespace OpenSim.Region.ClientStack.Linden
primFace.RepeatV = face.ScaleT;
primFace.TexMapType = (MappingType) (face.MediaFlags & 6);
}
+
pbs.TextureEntry = tmp.GetBytes();
prim.Shape = pbs;
prim.Scale = obj.Scale;
-
SceneObjectGroup grp = new SceneObjectGroup();
grp.SetRootPart(prim);
@@ -339,8 +339,8 @@ namespace OpenSim.Region.ClientStack.Linden
m_scene.AddSceneObject(grp);
grp.AbsolutePosition = obj.Position;
}
+
allparts[i] = grp;
-
}
for (int j = 1; j < allparts.Length; j++)
@@ -351,7 +351,9 @@ namespace OpenSim.Region.ClientStack.Linden
}
rootGroup.ScheduleGroupForFullUpdate();
- pos = m_scene.GetNewRezLocation(Vector3.Zero, rootpos, UUID.Zero, rot, (byte)1, 1, true, allparts[0].GroupScale(), false);
+ pos
+ = m_scene.GetNewRezLocation(
+ Vector3.Zero, rootpos, UUID.Zero, rot, (byte)1, 1, true, allparts[0].GroupScale, false);
responsedata["int_response_code"] = 200; //501; //410; //404;
responsedata["content_type"] = "text/plain";
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 8ffe84b..7aa7831 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -236,6 +236,38 @@ namespace OpenSim.Region.Framework.Scenes
get { return m_rootPart.RotationOffset; }
}
+ public Vector3 GroupScale
+ {
+ get
+ {
+ Vector3 minScale = new Vector3(Constants.RegionSize, Constants.RegionSize, Constants.RegionSize);
+ Vector3 maxScale = Vector3.Zero;
+ Vector3 finalScale = new Vector3(0.5f, 0.5f, 0.5f);
+
+ SceneObjectPart[] parts = m_parts.GetArray();
+ for (int i = 0; i < parts.Length; i++)
+ {
+ SceneObjectPart part = parts[i];
+ Vector3 partscale = part.Scale;
+ Vector3 partoffset = part.OffsetPosition;
+
+ minScale.X = (partscale.X + partoffset.X < minScale.X) ? partscale.X + partoffset.X : minScale.X;
+ minScale.Y = (partscale.Y + partoffset.Y < minScale.Y) ? partscale.Y + partoffset.Y : minScale.Y;
+ minScale.Z = (partscale.Z + partoffset.Z < minScale.Z) ? partscale.Z + partoffset.Z : minScale.Z;
+
+ maxScale.X = (partscale.X + partoffset.X > maxScale.X) ? partscale.X + partoffset.X : maxScale.X;
+ maxScale.Y = (partscale.Y + partoffset.Y > maxScale.Y) ? partscale.Y + partoffset.Y : maxScale.Y;
+ maxScale.Z = (partscale.Z + partoffset.Z > maxScale.Z) ? partscale.Z + partoffset.Z : maxScale.Z;
+ }
+
+ finalScale.X = (minScale.X > maxScale.X) ? minScale.X : maxScale.X;
+ finalScale.Y = (minScale.Y > maxScale.Y) ? minScale.Y : maxScale.Y;
+ finalScale.Z = (minScale.Z > maxScale.Z) ? minScale.Z : maxScale.Z;
+
+ return finalScale;
+ }
+ }
+
public UUID GroupID
{
get { return m_rootPart.GroupID; }
@@ -592,35 +624,6 @@ namespace OpenSim.Region.Framework.Scenes
//ScheduleGroupForFullUpdate();
}
- public Vector3 GroupScale()
- {
- Vector3 minScale = new Vector3(Constants.RegionSize, Constants.RegionSize, Constants.RegionSize);
- Vector3 maxScale = Vector3.Zero;
- Vector3 finalScale = new Vector3(0.5f, 0.5f, 0.5f);
-
- SceneObjectPart[] parts = m_parts.GetArray();
- for (int i = 0; i < parts.Length; i++)
- {
- SceneObjectPart part = parts[i];
- Vector3 partscale = part.Scale;
- Vector3 partoffset = part.OffsetPosition;
-
- minScale.X = (partscale.X + partoffset.X < minScale.X) ? partscale.X + partoffset.X : minScale.X;
- minScale.Y = (partscale.Y + partoffset.Y < minScale.Y) ? partscale.Y + partoffset.Y : minScale.Y;
- minScale.Z = (partscale.Z + partoffset.Z < minScale.Z) ? partscale.Z + partoffset.Z : minScale.Z;
-
- maxScale.X = (partscale.X + partoffset.X > maxScale.X) ? partscale.X + partoffset.X : maxScale.X;
- maxScale.Y = (partscale.Y + partoffset.Y > maxScale.Y) ? partscale.Y + partoffset.Y : maxScale.Y;
- maxScale.Z = (partscale.Z + partoffset.Z > maxScale.Z) ? partscale.Z + partoffset.Z : maxScale.Z;
- }
-
- finalScale.X = (minScale.X > maxScale.X) ? minScale.X : maxScale.X;
- finalScale.Y = (minScale.Y > maxScale.Y) ? minScale.Y : maxScale.Y;
- finalScale.Z = (minScale.Z > maxScale.Z) ? minScale.Z : maxScale.Z;
-
- return finalScale;
- }
-
public EntityIntersection TestIntersection(Ray hRay, bool frontFacesOnly, bool faceCenters)
{
// We got a request from the inner_scene to raytrace along the Ray hRay
--
cgit v1.1