diff options
author | Melanie | 2011-10-25 01:52:54 +0100 |
---|---|---|
committer | Melanie | 2011-10-25 01:52:54 +0100 |
commit | e43e1b49db84cb501030336508cef05be8cf26e4 (patch) | |
tree | f7c409e9d568de274d7856e696f1a5d23de986b0 /OpenSim | |
parent | Merge commit '978fb3d482072d840e6280aa5acd090b67ee6205' into bigmerge (diff) | |
parent | factor common code out into SOP.RemoveFromPhysics() (diff) | |
download | opensim-SC_OLD-e43e1b49db84cb501030336508cef05be8cf26e4.zip opensim-SC_OLD-e43e1b49db84cb501030336508cef05be8cf26e4.tar.gz opensim-SC_OLD-e43e1b49db84cb501030336508cef05be8cf26e4.tar.bz2 opensim-SC_OLD-e43e1b49db84cb501030336508cef05be8cf26e4.tar.xz |
Merge commit 'c93c9ea072f319125f466c913f5f4fe1f6864045' into bigmerge
Diffstat (limited to 'OpenSim')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | 5 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 3 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 22 |
3 files changed, 19 insertions, 11 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs index 09781c7..96766f3 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -536,10 +536,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
536 | so.AttachedAvatar = sp.UUID; | 536 | so.AttachedAvatar = sp.UUID; |
537 | 537 | ||
538 | if (so.RootPart.PhysActor != null) | 538 | if (so.RootPart.PhysActor != null) |
539 | { | 539 | so.RootPart.RemoveFromPhysics(); |
540 | m_scene.PhysicsScene.RemovePrim(so.RootPart.PhysActor); | ||
541 | so.RootPart.PhysActor = null; | ||
542 | } | ||
543 | 540 | ||
544 | so.AbsolutePosition = attachOffset; | 541 | so.AbsolutePosition = attachOffset; |
545 | so.RootPart.AttachedPos = attachOffset; | 542 | so.RootPart.AttachedPos = attachOffset; |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 935cac5..03b5d36 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2094,8 +2094,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2094 | } | 2094 | } |
2095 | else if (part.PhysActor != null) | 2095 | else if (part.PhysActor != null) |
2096 | { | 2096 | { |
2097 | PhysicsScene.RemovePrim(part.PhysActor); | 2097 | part.RemoveFromPhysics(); |
2098 | part.PhysActor = null; | ||
2099 | } | 2098 | } |
2100 | } | 2099 | } |
2101 | 2100 | ||
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 370c55b..1cdd567 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -1641,6 +1641,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1641 | m_log.ErrorFormat("[SCENE]: caught exception meshing object {0}. Object set to phantom.", m_uuid); | 1641 | m_log.ErrorFormat("[SCENE]: caught exception meshing object {0}. Object set to phantom.", m_uuid); |
1642 | PhysActor = null; | 1642 | PhysActor = null; |
1643 | } | 1643 | } |
1644 | |||
1644 | // Basic Physics returns null.. joy joy joy. | 1645 | // Basic Physics returns null.. joy joy joy. |
1645 | if (PhysActor != null) | 1646 | if (PhysActor != null) |
1646 | { | 1647 | { |
@@ -4454,12 +4455,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
4454 | || (Shape.PathCurve == (byte)Extrusion.Flexible)) // note: this may have been changed above in the case of joints | 4455 | || (Shape.PathCurve == (byte)Extrusion.Flexible)) // note: this may have been changed above in the case of joints |
4455 | { | 4456 | { |
4456 | AddFlag(PrimFlags.Phantom); | 4457 | AddFlag(PrimFlags.Phantom); |
4458 | |||
4457 | if (PhysActor != null) | 4459 | if (PhysActor != null) |
4458 | { | 4460 | RemoveFromPhysics(); |
4459 | m_parentGroup.Scene.PhysicsScene.RemovePrim(PhysActor); | ||
4460 | /// that's not wholesome. Had to make Scene public | ||
4461 | PhysActor = null; | ||
4462 | } | ||
4463 | } | 4461 | } |
4464 | else // Not phantom | 4462 | else // Not phantom |
4465 | { | 4463 | { |
@@ -4573,6 +4571,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
4573 | // m_log.DebugFormat("[SCENE OBJECT PART]: Updated PrimFlags on {0} {1} to {2}", Name, LocalId, Flags); | 4571 | // m_log.DebugFormat("[SCENE OBJECT PART]: Updated PrimFlags on {0} {1} to {2}", Name, LocalId, Flags); |
4574 | } | 4572 | } |
4575 | 4573 | ||
4574 | /// <summary> | ||
4575 | /// This removes the part from physics | ||
4576 | /// </summary> | ||
4577 | /// <remarks> | ||
4578 | /// This isn't the same as turning off physical, since even without being physical the prim has a physics | ||
4579 | /// representation for collision detection. Rather, this would be used in situations such as making a prim | ||
4580 | /// phantom. | ||
4581 | /// </remarks> | ||
4582 | public void RemoveFromPhysics() | ||
4583 | { | ||
4584 | ParentGroup.Scene.PhysicsScene.RemovePrim(PhysActor); | ||
4585 | PhysActor = null; | ||
4586 | } | ||
4587 | |||
4576 | public void UpdateRotation(Quaternion rot) | 4588 | public void UpdateRotation(Quaternion rot) |
4577 | { | 4589 | { |
4578 | if ((rot.X != RotationOffset.X) || | 4590 | if ((rot.X != RotationOffset.X) || |