diff options
author | UbitUmarov | 2012-04-29 06:39:09 +0100 |
---|---|---|
committer | UbitUmarov | 2012-04-29 06:39:09 +0100 |
commit | 84b5b3e89b4814c29b7782578dfcd6fa2f0c77f9 (patch) | |
tree | a16d492fc77aefb97ebdf6eac224a3cd31ddcc4a /OpenSim/Region | |
parent | remove repeated set of group rotation to physics (diff) | |
download | opensim-SC_OLD-84b5b3e89b4814c29b7782578dfcd6fa2f0c77f9.zip opensim-SC_OLD-84b5b3e89b4814c29b7782578dfcd6fa2f0c77f9.tar.gz opensim-SC_OLD-84b5b3e89b4814c29b7782578dfcd6fa2f0c77f9.tar.bz2 opensim-SC_OLD-84b5b3e89b4814c29b7782578dfcd6fa2f0c77f9.tar.xz |
llGetGeometricCenter...
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs | 16 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 3 |
2 files changed, 16 insertions, 3 deletions
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 | |||
4024 | if (nparts <= 1) | 4024 | if (nparts <= 1) |
4025 | return gc; | 4025 | return gc; |
4026 | 4026 | ||
4027 | Quaternion parentRot = RootPart.RotationOffset; | ||
4028 | Vector3 pPos; | ||
4029 | |||
4027 | // average all parts positions | 4030 | // average all parts positions |
4028 | for (int i = 0; i < nparts; i++) | 4031 | for (int i = 0; i < nparts; i++) |
4029 | gc += parts[i].GetWorldPosition(); | 4032 | { |
4033 | // do it directly | ||
4034 | // gc += parts[i].GetWorldPosition(); | ||
4035 | if (parts[i] != RootPart) | ||
4036 | { | ||
4037 | pPos = parts[i].OffsetPosition; | ||
4038 | gc += pPos; | ||
4039 | } | ||
4040 | |||
4041 | } | ||
4030 | gc /= nparts; | 4042 | gc /= nparts; |
4031 | 4043 | ||
4032 | // relative to root: | 4044 | // relative to root: |
4033 | gc -= AbsolutePosition; | 4045 | // gc -= AbsolutePosition; |
4034 | return gc; | 4046 | return gc; |
4035 | } | 4047 | } |
4036 | 4048 | ||
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index 6ee1a5d..0c28bf5 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -8527,7 +8527,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
8527 | 8527 | ||
8528 | public LSL_Vector llGetGeometricCenter() | 8528 | public LSL_Vector llGetGeometricCenter() |
8529 | { | 8529 | { |
8530 | return new LSL_Vector(m_host.GetGeometricCenter().X, m_host.GetGeometricCenter().Y, m_host.GetGeometricCenter().Z); | 8530 | Vector3 tmp = m_host.GetGeometricCenter(); |
8531 | return new LSL_Vector(tmp.X, tmp.Y, tmp.Z); | ||
8531 | } | 8532 | } |
8532 | 8533 | ||
8533 | public LSL_List llGetPrimitiveParams(LSL_List rules) | 8534 | public LSL_List llGetPrimitiveParams(LSL_List rules) |