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.cs40
1 files changed, 37 insertions, 3 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index c9659cb..b198ca7 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -1865,7 +1865,7 @@ namespace OpenSim.Region.Framework.Scenes
1865 { 1865 {
1866 if ((!isPhantom || isPhysical || _VolumeDetectActive) && !ParentGroup.IsAttachment 1866 if ((!isPhantom || isPhysical || _VolumeDetectActive) && !ParentGroup.IsAttachment
1867 && !(Shape.PathCurve == (byte)Extrusion.Flexible)) 1867 && !(Shape.PathCurve == (byte)Extrusion.Flexible))
1868 AddToPhysics(isPhysical, isPhantom, building, true); 1868 AddToPhysics(isPhysical, isPhantom, building, isPhysical);
1869 else 1869 else
1870 PhysActor = null; // just to be sure 1870 PhysActor = null; // just to be sure
1871 } 1871 }
@@ -2308,7 +2308,7 @@ namespace OpenSim.Region.Framework.Scenes
2308 */ 2308 */
2309 } 2309 }
2310 2310
2311 public float GetMass() 2311 public float GetMass()
2312 { 2312 {
2313 PhysicsActor pa = PhysActor; 2313 PhysicsActor pa = PhysActor;
2314 2314
@@ -2318,6 +2318,40 @@ namespace OpenSim.Region.Framework.Scenes
2318 return 0; 2318 return 0;
2319 } 2319 }
2320 2320
2321 public Vector3 GetCenterOfMass()
2322 {
2323 if (ParentGroup.RootPart == this)
2324 {
2325 if (ParentGroup.IsDeleted)
2326 return AbsolutePosition;
2327 return ParentGroup.GetCenterOfMass();
2328 }
2329
2330 PhysicsActor pa = PhysActor;
2331
2332 if (pa != null)
2333 {
2334 Vector3 tmp = pa.CenterOfMass;
2335 return tmp;
2336 }
2337 else
2338 return AbsolutePosition;
2339 }
2340
2341 public Vector3 GetPartCenterOfMass()
2342 {
2343 PhysicsActor pa = PhysActor;
2344
2345 if (pa != null)
2346 {
2347 Vector3 tmp = pa.CenterOfMass;
2348 return tmp;
2349 }
2350 else
2351 return AbsolutePosition;
2352 }
2353
2354
2321 public Vector3 GetForce() 2355 public Vector3 GetForce()
2322 { 2356 {
2323 return Force; 2357 return Force;
@@ -4802,7 +4836,7 @@ namespace OpenSim.Region.Framework.Scenes
4802 { 4836 {
4803 Velocity = velocity; 4837 Velocity = velocity;
4804 AngularVelocity = rotationalVelocity; 4838 AngularVelocity = rotationalVelocity;
4805 pa.Velocity = velocity; 4839// pa.Velocity = velocity;
4806 pa.RotationalVelocity = rotationalVelocity; 4840 pa.RotationalVelocity = rotationalVelocity;
4807 4841
4808 // if not vehicle and root part apply force and torque 4842 // if not vehicle and root part apply force and torque