aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs29
1 files changed, 20 insertions, 9 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index d419710..511ab19 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -2260,18 +2260,29 @@ namespace OpenSim.Region.Framework.Scenes
2260 2260
2261 public Vector3 GetGeometricCenter() 2261 public Vector3 GetGeometricCenter()
2262 { 2262 {
2263 PhysicsActor pa = PhysActor; 2263 // this is not real geometric center but a average of positions relative to root prim acording to
2264 2264 // http://wiki.secondlife.com/wiki/llGetGeometricCenter
2265 if (pa != null) 2265 // ignoring tortured prims details since sl also seems to ignore
2266 { 2266 // so no real use in doing it on physics
2267 Vector3 vtmp = pa.CenterOfMass; 2267 if (ParentGroup.IsDeleted)
2268 return vtmp;
2269 }
2270 else
2271 return new Vector3(0, 0, 0); 2268 return new Vector3(0, 0, 0);
2269
2270 return ParentGroup.GetGeometricCenter();
2271
2272 /*
2273 PhysicsActor pa = PhysActor;
2274
2275 if (pa != null)
2276 {
2277 Vector3 vtmp = pa.CenterOfMass;
2278 return vtmp;
2279 }
2280 else
2281 return new Vector3(0, 0, 0);
2282 */
2272 } 2283 }
2273 2284
2274 public float GetMass() 2285 public float GetMass()
2275 { 2286 {
2276 PhysicsActor pa = PhysActor; 2287 PhysicsActor pa = PhysActor;
2277 2288