diff options
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 58 |
1 files changed, 5 insertions, 53 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index ca5951c..6f2a1de 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -4741,9 +4741,11 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
4741 | 4741 | ||
4742 | VolumeDetectActive = SetVD; | 4742 | VolumeDetectActive = SetVD; |
4743 | 4743 | ||
4744 | // volume detector implies phantom | 4744 | // volume detector implies phantom we need to decouple this mess |
4745 | if (VolumeDetectActive) | 4745 | if (VolumeDetectActive) |
4746 | SetPhantom = true; | 4746 | SetPhantom = true; |
4747 | else if(wasVD) | ||
4748 | SetPhantom = false; | ||
4747 | 4749 | ||
4748 | if (UsePhysics) | 4750 | if (UsePhysics) |
4749 | AddFlag(PrimFlags.Physics); | 4751 | AddFlag(PrimFlags.Physics); |
@@ -4760,7 +4762,6 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
4760 | else | 4762 | else |
4761 | RemFlag(PrimFlags.TemporaryOnRez); | 4763 | RemFlag(PrimFlags.TemporaryOnRez); |
4762 | 4764 | ||
4763 | |||
4764 | if (ParentGroup.Scene == null) | 4765 | if (ParentGroup.Scene == null) |
4765 | return; | 4766 | return; |
4766 | 4767 | ||
@@ -4790,26 +4791,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
4790 | { | 4791 | { |
4791 | AddToPhysics(UsePhysics, SetPhantom, building, false); | 4792 | AddToPhysics(UsePhysics, SetPhantom, building, false); |
4792 | pa = PhysActor; | 4793 | pa = PhysActor; |
4793 | /* | 4794 | |
4794 | if (pa != null) | ||
4795 | { | ||
4796 | if ( | ||
4797 | // ((AggregateScriptEvents & scriptEvents.collision) != 0) || | ||
4798 | // ((AggregateScriptEvents & scriptEvents.collision_end) != 0) || | ||
4799 | // ((AggregateScriptEvents & scriptEvents.collision_start) != 0) || | ||
4800 | // ((AggregateScriptEvents & scriptEvents.land_collision_start) != 0) || | ||
4801 | // ((AggregateScriptEvents & scriptEvents.land_collision) != 0) || | ||
4802 | // ((AggregateScriptEvents & scriptEvents.land_collision_end) != 0) || | ||
4803 | ((AggregateScriptEvents & PhysicsNeededSubsEvents) != 0) || | ||
4804 | ((ParentGroup.RootPart.AggregateScriptEvents & PhysicsNeededSubsEvents) != 0) || | ||
4805 | (CollisionSound != UUID.Zero) | ||
4806 | ) | ||
4807 | { | ||
4808 | pa.OnCollisionUpdate += PhysicsCollision; | ||
4809 | pa.SubscribeEvents(1000); | ||
4810 | } | ||
4811 | } | ||
4812 | */ | ||
4813 | if (pa != null) | 4795 | if (pa != null) |
4814 | { | 4796 | { |
4815 | pa.SetMaterial(Material); | 4797 | pa.SetMaterial(Material); |
@@ -4820,12 +4802,6 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
4820 | { | 4802 | { |
4821 | 4803 | ||
4822 | DoPhysicsPropertyUpdate(UsePhysics, false); // Update physical status. | 4804 | DoPhysicsPropertyUpdate(UsePhysics, false); // Update physical status. |
4823 | /* moved into DoPhysicsPropertyUpdate | ||
4824 | if(VolumeDetectActive) | ||
4825 | pa.SetVolumeDetect(1); | ||
4826 | else | ||
4827 | pa.SetVolumeDetect(0); | ||
4828 | */ | ||
4829 | 4805 | ||
4830 | if (pa.Building != building) | 4806 | if (pa.Building != building) |
4831 | pa.Building = building; | 4807 | pa.Building = building; |
@@ -4834,32 +4810,8 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
4834 | UpdatePhysicsSubscribedEvents(); | 4810 | UpdatePhysicsSubscribedEvents(); |
4835 | } | 4811 | } |
4836 | } | 4812 | } |
4837 | if (SetVD) | ||
4838 | { | ||
4839 | // If the above logic worked (this is urgent candidate to unit tests!) | ||
4840 | // we now have a physicsactor. | ||
4841 | // Defensive programming calls for a check here. | ||
4842 | // Better would be throwing an exception that could be catched by a unit test as the internal | ||
4843 | // logic should make sure, this Physactor is always here. | ||
4844 | if (pa != null) | ||
4845 | { | ||
4846 | pa.SetVolumeDetect(1); | ||
4847 | AddFlag(PrimFlags.Phantom); // We set this flag also if VD is active | ||
4848 | VolumeDetectActive = true; | ||
4849 | } | ||
4850 | // m_log.Debug("Update: PHY:" + UsePhysics.ToString() + ", T:" + IsTemporary.ToString() + ", PHA:" + IsPhantom.ToString() + " S:" + CastsShadows.ToString()); | ||
4851 | } | ||
4852 | else if (SetVD != wasVD) | ||
4853 | { | ||
4854 | // Remove VolumeDetect in any case. Note, it's safe to call SetVolumeDetect as often as you like | ||
4855 | // (mumbles, well, at least if you have infinte CPU powers :-)) | ||
4856 | if (pa != null) | ||
4857 | pa.SetVolumeDetect(0); | ||
4858 | 4813 | ||
4859 | RemFlag(PrimFlags.Phantom); | 4814 | // and last in case we have a new actor and not building |
4860 | VolumeDetectActive = false; | ||
4861 | } | ||
4862 | // and last in case we have a new actor and not building | ||
4863 | 4815 | ||
4864 | if (ParentGroup != null) | 4816 | if (ParentGroup != null) |
4865 | { | 4817 | { |