diff options
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 10 | ||||
-rw-r--r-- | OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 44e8fdf..e0ea344 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -1952,6 +1952,16 @@ namespace OpenSim.Region.Framework.Scenes | |||
1952 | PhysicsActor pa = PhysActor; | 1952 | PhysicsActor pa = PhysActor; |
1953 | 1953 | ||
1954 | if (pa != null) | 1954 | if (pa != null) |
1955 | return new Vector3(pa.GeometricCenter.X, pa.GeometricCenter.Y, pa.GeometricCenter.Z); | ||
1956 | else | ||
1957 | return new Vector3(0, 0, 0); | ||
1958 | } | ||
1959 | |||
1960 | public Vector3 GetCenterOfMass() | ||
1961 | { | ||
1962 | PhysicsActor pa = PhysActor; | ||
1963 | |||
1964 | if (pa != null) | ||
1955 | return new Vector3(pa.CenterOfMass.X, pa.CenterOfMass.Y, pa.CenterOfMass.Z); | 1965 | return new Vector3(pa.CenterOfMass.X, pa.CenterOfMass.Y, pa.CenterOfMass.Z); |
1956 | else | 1966 | else |
1957 | return new Vector3(0, 0, 0); | 1967 | return new Vector3(0, 0, 0); |
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs index db5add1..507c399 100644 --- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs +++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs | |||
@@ -4923,7 +4923,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api | |||
4923 | public LSL_Vector llGetCenterOfMass() | 4923 | public LSL_Vector llGetCenterOfMass() |
4924 | { | 4924 | { |
4925 | m_host.AddScriptLPS(1); | 4925 | m_host.AddScriptLPS(1); |
4926 | Vector3 center = m_host.GetGeometricCenter(); | 4926 | Vector3 center = m_host.GetCenterOfMass(); |
4927 | return new LSL_Vector(center.X,center.Y,center.Z); | 4927 | return new LSL_Vector(center.X,center.Y,center.Z); |
4928 | } | 4928 | } |
4929 | 4929 | ||