aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs48
1 files changed, 38 insertions, 10 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index ace53f6..a68b3eb 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -1657,9 +1657,13 @@ namespace OpenSim.Region.Framework.Scenes
1657 if (!ParentGroup.Scene.CollidablePrims) 1657 if (!ParentGroup.Scene.CollidablePrims)
1658 return; 1658 return;
1659 1659
1660 if (PhysicsShapeType == (byte)PhysShapeType.none)
1661 return;
1662
1660 bool isPhysical = (rootObjectFlags & (uint) PrimFlags.Physics) != 0; 1663 bool isPhysical = (rootObjectFlags & (uint) PrimFlags.Physics) != 0;
1661 bool isPhantom = (rootObjectFlags & (uint) PrimFlags.Phantom) != 0; 1664 bool isPhantom = (rootObjectFlags & (uint) PrimFlags.Phantom) != 0;
1662 1665
1666
1663 if (IsJoint()) 1667 if (IsJoint())
1664 { 1668 {
1665 DoPhysicsPropertyUpdate(isPhysical, true); 1669 DoPhysicsPropertyUpdate(isPhysical, true);
@@ -2016,6 +2020,7 @@ namespace OpenSim.Region.Framework.Scenes
2016 if (PhysActor.Phantom != phan) 2020 if (PhysActor.Phantom != phan)
2017 PhysActor.Phantom = phan; 2021 PhysActor.Phantom = phan;
2018 2022
2023
2019 // If this part is a sculpt then delay the physics update until we've asynchronously loaded the 2024 // If this part is a sculpt then delay the physics update until we've asynchronously loaded the
2020 // mesh data. 2025 // mesh data.
2021 if (Shape.SculptEntry) 2026 if (Shape.SculptEntry)
@@ -4414,11 +4419,34 @@ namespace OpenSim.Region.Framework.Scenes
4414 if (physdata.PhysShapeType == PhysShapeType.invalid || ParentGroup == null) 4419 if (physdata.PhysShapeType == PhysShapeType.invalid || ParentGroup == null)
4415 return; 4420 return;
4416 4421
4417 PhysicsShapeType = (byte)physdata.PhysShapeType; 4422 if (PhysicsShapeType != (byte)physdata.PhysShapeType)
4418 Density = physdata.Density; 4423 {
4419 GravityModifier = physdata.GravitationModifier; 4424 PhysicsShapeType = (byte)physdata.PhysShapeType;
4420 Friction = physdata.Friction; 4425
4421 Bounciness = physdata.Bounce; 4426 if (PhysicsShapeType == (byte)PhysShapeType.none)
4427 {
4428 if (PhysActor != null)
4429 {
4430 Velocity = new Vector3(0, 0, 0);
4431 Acceleration = new Vector3(0, 0, 0);
4432 if (ParentGroup.RootPart == this)
4433 AngularVelocity = new Vector3(0, 0, 0);
4434 ParentGroup.Scene.RemovePhysicalPrim(1);
4435 RemoveFromPhysics();
4436 }
4437 }
4438 else if (PhysActor == null)
4439 ApplyPhysics((uint)Flags, VolumeDetectActive, false);
4440 }
4441
4442 if(Density != physdata.Density)
4443 Density = physdata.Density;
4444 if(GravityModifier != physdata.GravitationModifier)
4445 GravityModifier = physdata.GravitationModifier;
4446 if(Friction != physdata.Friction)
4447 Friction = physdata.Friction;
4448 if(Bounciness != physdata.Bounce)
4449 Bounciness = physdata.Bounce;
4422 } 4450 }
4423 /// <summary> 4451 /// <summary>
4424 /// Update the flags on this prim. This covers properties such as phantom, physics and temporary. 4452 /// Update the flags on this prim. This covers properties such as phantom, physics and temporary.
@@ -4448,9 +4476,10 @@ namespace OpenSim.Region.Framework.Scenes
4448 // ... if VD is changed, all others are not. 4476 // ... if VD is changed, all others are not.
4449 // ... if one of the others is changed, VD is not. 4477 // ... if one of the others is changed, VD is not.
4450 4478
4479/*
4451 if (SetVD) // VD is active, special logic applies 4480 if (SetVD) // VD is active, special logic applies
4452 4481
4453 /* volume detection is now independent of phantom in sl 4482 volume detection is now independent of phantom in sl
4454 4483
4455 { 4484 {
4456 // State machine logic for VolumeDetect 4485 // State machine logic for VolumeDetect
@@ -4471,9 +4500,8 @@ namespace OpenSim.Region.Framework.Scenes
4471 // If volumedetect is active we don't want phantom to be applied. 4500 // If volumedetect is active we don't want phantom to be applied.
4472 // If this is a new call to VD out of the state "phantom" 4501 // If this is a new call to VD out of the state "phantom"
4473 // this will also cause the prim to be visible to physics 4502 // this will also cause the prim to be visible to physics
4474 */
4475 SetPhantom = false; 4503 SetPhantom = false;
4476/* } 4504 }
4477 } 4505 }
4478 else if (wasVD) 4506 else if (wasVD)
4479 { 4507 {
@@ -4520,10 +4548,10 @@ namespace OpenSim.Region.Framework.Scenes
4520 else 4548 else
4521 RemFlag(PrimFlags.Phantom); 4549 RemFlag(PrimFlags.Phantom);
4522 4550
4523 if ((SetPhantom && !UsePhysics) || ParentGroup.IsAttachment 4551 if ((SetPhantom && !UsePhysics) || ParentGroup.IsAttachment || PhysicsShapeType == (byte)PhysShapeType.none
4524 || (Shape.PathCurve == (byte)Extrusion.Flexible)) // note: this may have been changed above in the case of joints 4552 || (Shape.PathCurve == (byte)Extrusion.Flexible)) // note: this may have been changed above in the case of joints
4525 { 4553 {
4526 AddFlag(PrimFlags.Phantom); 4554// AddFlag(PrimFlags.Phantom);
4527 4555
4528 Velocity = new Vector3(0, 0, 0); 4556 Velocity = new Vector3(0, 0, 0);
4529 Acceleration = new Vector3(0, 0, 0); 4557 Acceleration = new Vector3(0, 0, 0);