diff options
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneGraph.cs | 14 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 39 |
2 files changed, 40 insertions, 13 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index cd4bd42..b7dc335 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -1516,8 +1516,18 @@ namespace OpenSim.Region.Framework.Scenes | |||
1516 | if (m_parentScene.Permissions.CanEditObject(group.UUID, remoteClient.AgentId)) | 1516 | if (m_parentScene.Permissions.CanEditObject(group.UUID, remoteClient.AgentId)) |
1517 | { | 1517 | { |
1518 | // VolumeDetect can't be set via UI and will always be off when a change is made there | 1518 | // VolumeDetect can't be set via UI and will always be off when a change is made there |
1519 | if (PhysData.PhysShapeType == PhysShapeType.invalid) | 1519 | // now only change volume dtc if phantom off |
1520 | group.UpdatePrimFlags(localID, UsePhysics, SetTemporary, SetPhantom, false); | 1520 | |
1521 | if (PhysData.PhysShapeType == PhysShapeType.invalid) // check for extraPhysics data | ||
1522 | { | ||
1523 | bool vdtc; | ||
1524 | if (SetPhantom) // if phantom keep volumedtc | ||
1525 | vdtc = group.RootPart.VolumeDetectActive; | ||
1526 | else // else turn it off | ||
1527 | vdtc = false; | ||
1528 | |||
1529 | group.UpdatePrimFlags(localID, UsePhysics, SetTemporary, SetPhantom, vdtc); | ||
1530 | } | ||
1521 | else | 1531 | else |
1522 | { | 1532 | { |
1523 | SceneObjectPart part = GetSceneObjectPart(localID); | 1533 | SceneObjectPart part = GetSceneObjectPart(localID); |
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 511ab19..c73fc98 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -1830,7 +1830,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
1830 | 1830 | ||
1831 | public void ApplyPhysics(uint _ObjectFlags, bool _VolumeDetectActive, bool building) | 1831 | public void ApplyPhysics(uint _ObjectFlags, bool _VolumeDetectActive, bool building) |
1832 | { | 1832 | { |
1833 | VolumeDetectActive = _VolumeDetectActive; //?? as is used this is redundante | 1833 | VolumeDetectActive = _VolumeDetectActive; |
1834 | 1834 | ||
1835 | if (!ParentGroup.Scene.CollidablePrims) | 1835 | if (!ParentGroup.Scene.CollidablePrims) |
1836 | return; | 1836 | return; |
@@ -1839,7 +1839,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
1839 | return; | 1839 | return; |
1840 | 1840 | ||
1841 | bool isPhysical = (_ObjectFlags & (uint) PrimFlags.Physics) != 0; | 1841 | bool isPhysical = (_ObjectFlags & (uint) PrimFlags.Physics) != 0; |
1842 | bool isPhantom = (_ObjectFlags & (uint) PrimFlags.Phantom) != 0; | 1842 | bool isPhantom = (_ObjectFlags & (uint)PrimFlags.Phantom) != 0; |
1843 | |||
1844 | if (_VolumeDetectActive) | ||
1845 | isPhantom = true; | ||
1843 | 1846 | ||
1844 | if (IsJoint()) | 1847 | if (IsJoint()) |
1845 | { | 1848 | { |
@@ -2065,6 +2068,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2065 | 2068 | ||
2066 | /// <summary> | 2069 | /// <summary> |
2067 | /// Do a physics propery update for this part. | 2070 | /// Do a physics propery update for this part. |
2071 | /// now also updates phantom and volume detector | ||
2068 | /// </summary> | 2072 | /// </summary> |
2069 | /// <param name="UsePhysics"></param> | 2073 | /// <param name="UsePhysics"></param> |
2070 | /// <param name="isNew"></param> | 2074 | /// <param name="isNew"></param> |
@@ -2096,7 +2100,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2096 | if (ParentGroup.RootPart == this) | 2100 | if (ParentGroup.RootPart == this) |
2097 | AngularVelocity = new Vector3(0, 0, 0); | 2101 | AngularVelocity = new Vector3(0, 0, 0); |
2098 | 2102 | ||
2099 | if (pa.Phantom) | 2103 | if (pa.Phantom && !VolumeDetectActive) |
2100 | { | 2104 | { |
2101 | RemoveFromPhysics(); | 2105 | RemoveFromPhysics(); |
2102 | return; | 2106 | return; |
@@ -2143,6 +2147,14 @@ namespace OpenSim.Region.Framework.Scenes | |||
2143 | if (pa.Phantom != phan) | 2147 | if (pa.Phantom != phan) |
2144 | pa.Phantom = phan; | 2148 | pa.Phantom = phan; |
2145 | 2149 | ||
2150 | // some engines dont' have this check still | ||
2151 | // if (VolumeDetectActive != pa.IsVolumeDtc) | ||
2152 | { | ||
2153 | if (VolumeDetectActive) | ||
2154 | pa.SetVolumeDetect(1); | ||
2155 | else | ||
2156 | pa.SetVolumeDetect(0); | ||
2157 | } | ||
2146 | 2158 | ||
2147 | // If this part is a sculpt then delay the physics update until we've asynchronously loaded the | 2159 | // If this part is a sculpt then delay the physics update until we've asynchronously loaded the |
2148 | // mesh data. | 2160 | // mesh data. |
@@ -4599,6 +4611,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
4599 | if ((UsePhysics == wasUsingPhysics) && (wasTemporary == SetTemporary) && (wasPhantom == SetPhantom) && (SetVD == wasVD)) | 4611 | if ((UsePhysics == wasUsingPhysics) && (wasTemporary == SetTemporary) && (wasPhantom == SetPhantom) && (SetVD == wasVD)) |
4600 | return; | 4612 | return; |
4601 | 4613 | ||
4614 | VolumeDetectActive = SetVD; | ||
4615 | |||
4616 | // volume detector implies phantom | ||
4617 | if (VolumeDetectActive) | ||
4618 | SetPhantom = true; | ||
4619 | |||
4602 | if (UsePhysics) | 4620 | if (UsePhysics) |
4603 | AddFlag(PrimFlags.Physics); | 4621 | AddFlag(PrimFlags.Physics); |
4604 | else | 4622 | else |
@@ -4614,7 +4632,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
4614 | else | 4632 | else |
4615 | RemFlag(PrimFlags.TemporaryOnRez); | 4633 | RemFlag(PrimFlags.TemporaryOnRez); |
4616 | 4634 | ||
4617 | VolumeDetectActive = SetVD; | ||
4618 | 4635 | ||
4619 | if (ParentGroup.Scene == null) | 4636 | if (ParentGroup.Scene == null) |
4620 | return; | 4637 | return; |
@@ -4624,7 +4641,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
4624 | if (pa != null && building && pa.Building != building) | 4641 | if (pa != null && building && pa.Building != building) |
4625 | pa.Building = building; | 4642 | pa.Building = building; |
4626 | 4643 | ||
4627 | if ((SetPhantom && !UsePhysics) || ParentGroup.IsAttachment || PhysicsShapeType == (byte)PhysShapeType.none | 4644 | if ((SetPhantom && !UsePhysics && !SetVD) || ParentGroup.IsAttachment || PhysicsShapeType == (byte)PhysShapeType.none |
4628 | || (Shape.PathCurve == (byte)Extrusion.Flexible)) | 4645 | || (Shape.PathCurve == (byte)Extrusion.Flexible)) |
4629 | { | 4646 | { |
4630 | if (pa != null) | 4647 | if (pa != null) |
@@ -4669,12 +4686,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
4669 | else // it already has a physical representation | 4686 | else // it already has a physical representation |
4670 | { | 4687 | { |
4671 | DoPhysicsPropertyUpdate(UsePhysics, false); // Update physical status. | 4688 | DoPhysicsPropertyUpdate(UsePhysics, false); // Update physical status. |
4672 | 4689 | /* moved into DoPhysicsPropertyUpdate | |
4673 | if(VolumeDetectActive) | 4690 | if(VolumeDetectActive) |
4674 | pa.SetVolumeDetect(1); | 4691 | pa.SetVolumeDetect(1); |
4675 | else | 4692 | else |
4676 | pa.SetVolumeDetect(0); | 4693 | pa.SetVolumeDetect(0); |
4677 | 4694 | */ | |
4678 | if (pa.Building != building) | 4695 | if (pa.Building != building) |
4679 | pa.Building = building; | 4696 | pa.Building = building; |
4680 | } | 4697 | } |