diff options
author | UbitUmarov | 2012-04-09 23:33:42 +0100 |
---|---|---|
committer | UbitUmarov | 2012-04-09 23:33:42 +0100 |
commit | c4a9eae961030280473f6df77e59cb53865535b6 (patch) | |
tree | 0c067ce26208b6e578f9ab40f0f5d77b9f25b9a8 /OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |
parent | chODE and ubitODE always return prim mass (they where returning object mass o... (diff) | |
download | opensim-SC_OLD-c4a9eae961030280473f6df77e59cb53865535b6.zip opensim-SC_OLD-c4a9eae961030280473f6df77e59cb53865535b6.tar.gz opensim-SC_OLD-c4a9eae961030280473f6df77e59cb53865535b6.tar.bz2 opensim-SC_OLD-c4a9eae961030280473f6df77e59cb53865535b6.tar.xz |
make llGetGeometricCenter() work as in current SL. Now this is not real geom center but a average of positions relative to root prim ignoring prims details, so no need to use physics engine.
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 29 |
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 | ||