From 84b5b3e89b4814c29b7782578dfcd6fa2f0c77f9 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sun, 29 Apr 2012 06:39:09 +0100 Subject: llGetGeometricCenter... --- OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'OpenSim/Region/Framework') diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs index bc2ca4c..f81cfe2 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs @@ -4024,13 +4024,25 @@ namespace OpenSim.Region.Framework.Scenes if (nparts <= 1) return gc; + Quaternion parentRot = RootPart.RotationOffset; + Vector3 pPos; + // average all parts positions for (int i = 0; i < nparts; i++) - gc += parts[i].GetWorldPosition(); + { + // do it directly + // gc += parts[i].GetWorldPosition(); + if (parts[i] != RootPart) + { + pPos = parts[i].OffsetPosition; + gc += pPos; + } + + } gc /= nparts; // relative to root: - gc -= AbsolutePosition; +// gc -= AbsolutePosition; return gc; } -- cgit v1.1