aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes
diff options
context:
space:
mode:
authorMelanie2012-05-02 00:33:56 +0200
committerMelanie2012-05-02 00:33:56 +0200
commit58d460542d592260877b2b2951616df3b974631d (patch)
treec52116f44b0d904b6755171549273a5577652e1c /OpenSim/Region/Framework/Scenes
parentMerge branch 'avination' (diff)
parentMerge branch 'ubitwork' into avination (diff)
downloadopensim-SC-58d460542d592260877b2b2951616df3b974631d.zip
opensim-SC-58d460542d592260877b2b2951616df3b974631d.tar.gz
opensim-SC-58d460542d592260877b2b2951616df3b974631d.tar.bz2
opensim-SC-58d460542d592260877b2b2951616df3b974631d.tar.xz
Merge branch 'avination'
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs16
1 files changed, 14 insertions, 2 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index f1657d9..dce20c1 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -4046,13 +4046,25 @@ namespace OpenSim.Region.Framework.Scenes
4046 if (nparts <= 1) 4046 if (nparts <= 1)
4047 return gc; 4047 return gc;
4048 4048
4049 Quaternion parentRot = RootPart.RotationOffset;
4050 Vector3 pPos;
4051
4049 // average all parts positions 4052 // average all parts positions
4050 for (int i = 0; i < nparts; i++) 4053 for (int i = 0; i < nparts; i++)
4051 gc += parts[i].GetWorldPosition(); 4054 {
4055 // do it directly
4056 // gc += parts[i].GetWorldPosition();
4057 if (parts[i] != RootPart)
4058 {
4059 pPos = parts[i].OffsetPosition;
4060 gc += pPos;
4061 }
4062
4063 }
4052 gc /= nparts; 4064 gc /= nparts;
4053 4065
4054 // relative to root: 4066 // relative to root:
4055 gc -= AbsolutePosition; 4067// gc -= AbsolutePosition;
4056 return gc; 4068 return gc;
4057 } 4069 }
4058 4070