diff options
author | Justin Clark-Casey (justincc) | 2011-10-15 02:02:39 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-10-15 02:02:39 +0100 |
commit | c93c9ea072f319125f466c913f5f4fe1f6864045 (patch) | |
tree | ce4c0f6f47582c01f8c27fe47a2e78c4d4fed0db | |
parent | reduce access to ODECharacter methods to make code analysis easier. Eliminat... (diff) | |
download | opensim-SC_OLD-c93c9ea072f319125f466c913f5f4fe1f6864045.zip opensim-SC_OLD-c93c9ea072f319125f466c913f5f4fe1f6864045.tar.gz opensim-SC_OLD-c93c9ea072f319125f466c913f5f4fe1f6864045.tar.bz2 opensim-SC_OLD-c93c9ea072f319125f466c913f5f4fe1f6864045.tar.xz |
factor common code out into SOP.RemoveFromPhysics()
Diffstat (limited to '')
-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 f893eb3..01f4808 100644 --- a/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/Attachments/AttachmentsModule.cs | |||
@@ -530,10 +530,7 @@ namespace OpenSim.Region.CoreModules.Avatar.Attachments | |||
530 | so.AttachedAvatar = sp.UUID; | 530 | so.AttachedAvatar = sp.UUID; |
531 | 531 | ||
532 | if (so.RootPart.PhysActor != null) | 532 | if (so.RootPart.PhysActor != null) |
533 | { | 533 | so.RootPart.RemoveFromPhysics(); |
534 | m_scene.PhysicsScene.RemovePrim(so.RootPart.PhysActor); | ||
535 | so.RootPart.PhysActor = null; | ||
536 | } | ||
537 | 534 | ||
538 | so.AbsolutePosition = attachOffset; | 535 | so.AbsolutePosition = attachOffset; |
539 | so.RootPart.AttachedPos = attachOffset; | 536 | so.RootPart.AttachedPos = attachOffset; |
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index f2b7014..a6ffe6e 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2023,8 +2023,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2023 | } | 2023 | } |
2024 | else if (part.PhysActor != null) | 2024 | else if (part.PhysActor != null) |
2025 | { | 2025 | { |
2026 | PhysicsScene.RemovePrim(part.PhysActor); | 2026 | part.RemoveFromPhysics(); |
2027 | part.PhysActor = null; | ||
2028 | } | 2027 | } |
2029 | } | 2028 | } |
2030 | 2029 | ||
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index e52131e..822d54f 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -1589,6 +1589,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1589 | m_log.ErrorFormat("[SCENE]: caught exception meshing object {0}. Object set to phantom.", m_uuid); | 1589 | m_log.ErrorFormat("[SCENE]: caught exception meshing object {0}. Object set to phantom.", m_uuid); |
1590 | PhysActor = null; | 1590 | PhysActor = null; |
1591 | } | 1591 | } |
1592 | |||
1592 | // Basic Physics returns null.. joy joy joy. | 1593 | // Basic Physics returns null.. joy joy joy. |
1593 | if (PhysActor != null) | 1594 | if (PhysActor != null) |
1594 | { | 1595 | { |
@@ -4399,12 +4400,9 @@ namespace OpenSim.Region.Framework.Scenes | |||
4399 | || (Shape.PathCurve == (byte)Extrusion.Flexible)) // note: this may have been changed above in the case of joints | 4400 | || (Shape.PathCurve == (byte)Extrusion.Flexible)) // note: this may have been changed above in the case of joints |
4400 | { | 4401 | { |
4401 | AddFlag(PrimFlags.Phantom); | 4402 | AddFlag(PrimFlags.Phantom); |
4403 | |||
4402 | if (PhysActor != null) | 4404 | if (PhysActor != null) |
4403 | { | 4405 | RemoveFromPhysics(); |
4404 | m_parentGroup.Scene.PhysicsScene.RemovePrim(PhysActor); | ||
4405 | /// that's not wholesome. Had to make Scene public | ||
4406 | PhysActor = null; | ||
4407 | } | ||
4408 | } | 4406 | } |
4409 | else // Not phantom | 4407 | else // Not phantom |
4410 | { | 4408 | { |
@@ -4518,6 +4516,20 @@ namespace OpenSim.Region.Framework.Scenes | |||
4518 | // m_log.DebugFormat("[SCENE OBJECT PART]: Updated PrimFlags on {0} {1} to {2}", Name, LocalId, Flags); | 4516 | // m_log.DebugFormat("[SCENE OBJECT PART]: Updated PrimFlags on {0} {1} to {2}", Name, LocalId, Flags); |
4519 | } | 4517 | } |
4520 | 4518 | ||
4519 | /// <summary> | ||
4520 | /// This removes the part from physics | ||
4521 | /// </summary> | ||
4522 | /// <remarks> | ||
4523 | /// This isn't the same as turning off physical, since even without being physical the prim has a physics | ||
4524 | /// representation for collision detection. Rather, this would be used in situations such as making a prim | ||
4525 | /// phantom. | ||
4526 | /// </remarks> | ||
4527 | public void RemoveFromPhysics() | ||
4528 | { | ||
4529 | ParentGroup.Scene.PhysicsScene.RemovePrim(PhysActor); | ||
4530 | PhysActor = null; | ||
4531 | } | ||
4532 | |||
4521 | public void UpdateRotation(Quaternion rot) | 4533 | public void UpdateRotation(Quaternion rot) |
4522 | { | 4534 | { |
4523 | if ((rot.X != RotationOffset.X) || | 4535 | if ((rot.X != RotationOffset.X) || |