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.cs45
1 files changed, 28 insertions, 17 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 85d2bee..51a3c18 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -1497,6 +1497,7 @@ namespace OpenSim.Region.Framework.Scenes
1497 get { return m_physicsShapeType; } 1497 get { return m_physicsShapeType; }
1498 set 1498 set
1499 { 1499 {
1500 byte oldv = m_physicsShapeType;
1500 if (value >= 0 && value <= (byte)PhysShapeType.convex) 1501 if (value >= 0 && value <= (byte)PhysShapeType.convex)
1501 { 1502 {
1502 if (value == (byte)PhysShapeType.none && ParentGroup != null && ParentGroup.RootPart == this) 1503 if (value == (byte)PhysShapeType.none && ParentGroup != null && ParentGroup.RootPart == this)
@@ -1507,11 +1508,33 @@ namespace OpenSim.Region.Framework.Scenes
1507 else 1508 else
1508 m_physicsShapeType = DefaultPhysicsShapeType(); 1509 m_physicsShapeType = DefaultPhysicsShapeType();
1509 1510
1510 if (ParentGroup != null)
1511 ParentGroup.HasGroupChanged = true;
1512 1511
1513 if(m_physicsShapeType != value) 1512 if (m_physicsShapeType != oldv && ParentGroup != null)
1513 {
1514 if (m_physicsShapeType == (byte)PhysShapeType.none)
1515 {
1516 if (PhysActor != null)
1517 {
1518 Velocity = new Vector3(0, 0, 0);
1519 Acceleration = new Vector3(0, 0, 0);
1520 if (ParentGroup.RootPart == this)
1521 AngularVelocity = new Vector3(0, 0, 0);
1522 ParentGroup.Scene.RemovePhysicalPrim(1);
1523 RemoveFromPhysics();
1524 }
1525 }
1526 else if (PhysActor == null)
1527 ApplyPhysics((uint)Flags, VolumeDetectActive, false);
1528 else
1529 PhysActor.PhysicsShapeType = m_physicsShapeType;
1530 }
1531 if (m_physicsShapeType != value)
1532 {
1533 if (ParentGroup != null)
1534 ParentGroup.HasGroupChanged = true;
1535
1514 UpdatePhysRequired = true; 1536 UpdatePhysRequired = true;
1537 }
1515 } 1538 }
1516 } 1539 }
1517 1540
@@ -1832,6 +1855,7 @@ namespace OpenSim.Region.Framework.Scenes
1832 GetWorldRotation(), 1855 GetWorldRotation(),
1833 isPhysical, 1856 isPhysical,
1834 isPhantom, 1857 isPhantom,
1858 PhysicsShapeType,
1835 m_localId); 1859 m_localId);
1836 } 1860 }
1837 catch 1861 catch
@@ -4574,20 +4598,6 @@ namespace OpenSim.Region.Framework.Scenes
4574 { 4598 {
4575 PhysicsShapeType = (byte)physdata.PhysShapeType; 4599 PhysicsShapeType = (byte)physdata.PhysShapeType;
4576 4600
4577 if (PhysicsShapeType == (byte)PhysShapeType.none)
4578 {
4579 if (PhysActor != null)
4580 {
4581 Velocity = new Vector3(0, 0, 0);
4582 Acceleration = new Vector3(0, 0, 0);
4583 if (ParentGroup.RootPart == this)
4584 AngularVelocity = new Vector3(0, 0, 0);
4585 ParentGroup.Scene.RemovePhysicalPrim(1);
4586 RemoveFromPhysics();
4587 }
4588 }
4589 else if (PhysActor == null)
4590 ApplyPhysics((uint)Flags, VolumeDetectActive, false);
4591 } 4601 }
4592 4602
4593 if(Density != physdata.Density) 4603 if(Density != physdata.Density)
@@ -4732,6 +4742,7 @@ namespace OpenSim.Region.Framework.Scenes
4732 GetWorldRotation(), //physics wants world rotation like all other functions send 4742 GetWorldRotation(), //physics wants world rotation like all other functions send
4733 UsePhysics, 4743 UsePhysics,
4734 SetPhantom, 4744 SetPhantom,
4745 PhysicsShapeType,
4735 m_localId); 4746 m_localId);
4736 4747
4737 PhysActor.SetMaterial(Material); 4748 PhysActor.SetMaterial(Material);