diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 16 |
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 | ||