diff options
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectPart.cs')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | 79 |
1 files changed, 54 insertions, 25 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs index 01a323e..fcc3463 100644 --- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs | |||
@@ -345,6 +345,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
345 | private string m_text = String.Empty; | 345 | private string m_text = String.Empty; |
346 | private string m_touchName = String.Empty; | 346 | private string m_touchName = String.Empty; |
347 | private UndoRedoState m_UndoRedo = null; | 347 | private UndoRedoState m_UndoRedo = null; |
348 | private object m_UndoLock = new object(); | ||
348 | 349 | ||
349 | private bool m_passTouches = false; | 350 | private bool m_passTouches = false; |
350 | private bool m_passCollisions = false; | 351 | private bool m_passCollisions = false; |
@@ -399,13 +400,12 @@ namespace OpenSim.Region.Framework.Scenes | |||
399 | 400 | ||
400 | 401 | ||
401 | // 0 for default collision sounds, -1 for script disabled sound 1 for script defined sound | 402 | // 0 for default collision sounds, -1 for script disabled sound 1 for script defined sound |
402 | private sbyte m_collisionSoundType; | 403 | private sbyte m_collisionSoundType = 0; |
403 | private UUID m_collisionSound; | 404 | private UUID m_collisionSound; |
404 | private float m_collisionSoundVolume; | 405 | private float m_collisionSoundVolume; |
405 | 406 | ||
406 | private int LastColSoundSentTime; | 407 | private int LastColSoundSentTime; |
407 | 408 | ||
408 | |||
409 | private SOPVehicle m_vehicleParams = null; | 409 | private SOPVehicle m_vehicleParams = null; |
410 | 410 | ||
411 | public KeyframeMotion KeyframeMotion | 411 | public KeyframeMotion KeyframeMotion |
@@ -1534,7 +1534,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1534 | else | 1534 | else |
1535 | m_collisionSoundType = 1; | 1535 | m_collisionSoundType = 1; |
1536 | 1536 | ||
1537 | aggregateScriptEvents(); | ||
1538 | } | 1537 | } |
1539 | } | 1538 | } |
1540 | 1539 | ||
@@ -2164,7 +2163,10 @@ namespace OpenSim.Region.Framework.Scenes | |||
2164 | UpdatePhysicsSubscribedEvents(); // not sure if appliable here | 2163 | UpdatePhysicsSubscribedEvents(); // not sure if appliable here |
2165 | } | 2164 | } |
2166 | else | 2165 | else |
2166 | { | ||
2167 | PhysActor = null; // just to be sure | 2167 | PhysActor = null; // just to be sure |
2168 | RemFlag(PrimFlags.CameraDecoupled); | ||
2169 | } | ||
2168 | } | 2170 | } |
2169 | } | 2171 | } |
2170 | 2172 | ||
@@ -3539,6 +3541,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
3539 | set | 3541 | set |
3540 | { | 3542 | { |
3541 | m_vehicleParams = value; | 3543 | m_vehicleParams = value; |
3544 | |||
3542 | } | 3545 | } |
3543 | } | 3546 | } |
3544 | 3547 | ||
@@ -3583,7 +3586,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
3583 | 3586 | ||
3584 | m_vehicleParams.ProcessVehicleFlags(param, remove); | 3587 | m_vehicleParams.ProcessVehicleFlags(param, remove); |
3585 | 3588 | ||
3586 | if (_parentID ==0 && PhysActor != null) | 3589 | if (_parentID == 0 && PhysActor != null) |
3587 | { | 3590 | { |
3588 | PhysActor.VehicleFlags(param, remove); | 3591 | PhysActor.VehicleFlags(param, remove); |
3589 | } | 3592 | } |
@@ -3932,11 +3935,11 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
3932 | 3935 | ||
3933 | public void StoreUndoState(ObjectChangeType change) | 3936 | public void StoreUndoState(ObjectChangeType change) |
3934 | { | 3937 | { |
3935 | if (m_UndoRedo == null) | 3938 | lock (m_UndoLock) |
3936 | m_UndoRedo = new UndoRedoState(5); | ||
3937 | |||
3938 | lock (m_UndoRedo) | ||
3939 | { | 3939 | { |
3940 | if (m_UndoRedo == null) | ||
3941 | m_UndoRedo = new UndoRedoState(5); | ||
3942 | |||
3940 | if (!Undoing && !IgnoreUndoUpdate && ParentGroup != null) // just to read better - undo is in progress, or suspended | 3943 | if (!Undoing && !IgnoreUndoUpdate && ParentGroup != null) // just to read better - undo is in progress, or suspended |
3941 | { | 3944 | { |
3942 | m_UndoRedo.StoreUndo(this, change); | 3945 | m_UndoRedo.StoreUndo(this, change); |
@@ -3959,11 +3962,11 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
3959 | 3962 | ||
3960 | public void Undo() | 3963 | public void Undo() |
3961 | { | 3964 | { |
3962 | if (m_UndoRedo == null || Undoing || ParentGroup == null) | 3965 | lock (m_UndoLock) |
3963 | return; | ||
3964 | |||
3965 | lock (m_UndoRedo) | ||
3966 | { | 3966 | { |
3967 | if (m_UndoRedo == null || Undoing || ParentGroup == null) | ||
3968 | return; | ||
3969 | |||
3967 | Undoing = true; | 3970 | Undoing = true; |
3968 | m_UndoRedo.Undo(this); | 3971 | m_UndoRedo.Undo(this); |
3969 | Undoing = false; | 3972 | Undoing = false; |
@@ -3972,11 +3975,11 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
3972 | 3975 | ||
3973 | public void Redo() | 3976 | public void Redo() |
3974 | { | 3977 | { |
3975 | if (m_UndoRedo == null || Undoing || ParentGroup == null) | 3978 | lock (m_UndoLock) |
3976 | return; | ||
3977 | |||
3978 | lock (m_UndoRedo) | ||
3979 | { | 3979 | { |
3980 | if (m_UndoRedo == null || Undoing || ParentGroup == null) | ||
3981 | return; | ||
3982 | |||
3980 | Undoing = true; | 3983 | Undoing = true; |
3981 | m_UndoRedo.Redo(this); | 3984 | m_UndoRedo.Redo(this); |
3982 | Undoing = false; | 3985 | Undoing = false; |
@@ -3985,11 +3988,11 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
3985 | 3988 | ||
3986 | public void ClearUndoState() | 3989 | public void ClearUndoState() |
3987 | { | 3990 | { |
3988 | if (m_UndoRedo == null || Undoing) | 3991 | lock (m_UndoLock) |
3989 | return; | ||
3990 | |||
3991 | lock (m_UndoRedo) | ||
3992 | { | 3992 | { |
3993 | if (m_UndoRedo == null || Undoing) | ||
3994 | return; | ||
3995 | |||
3993 | m_UndoRedo.Clear(); | 3996 | m_UndoRedo.Clear(); |
3994 | } | 3997 | } |
3995 | } | 3998 | } |
@@ -4722,9 +4725,16 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
4722 | if (VolumeDetectActive) // change if not the default only | 4725 | if (VolumeDetectActive) // change if not the default only |
4723 | pa.SetVolumeDetect(1); | 4726 | pa.SetVolumeDetect(1); |
4724 | 4727 | ||
4725 | if (m_vehicleParams != null && LocalId == ParentGroup.RootPart.LocalId) | 4728 | if (m_vehicleParams != null && m_localId == ParentGroup.RootPart.LocalId) |
4729 | { | ||
4726 | m_vehicleParams.SetVehicle(pa); | 4730 | m_vehicleParams.SetVehicle(pa); |
4727 | 4731 | if(isPhysical && !isPhantom && m_vehicleParams.CameraDecoupled) | |
4732 | AddFlag(PrimFlags.CameraDecoupled); | ||
4733 | else | ||
4734 | RemFlag(PrimFlags.CameraDecoupled); | ||
4735 | } | ||
4736 | else | ||
4737 | RemFlag(PrimFlags.CameraDecoupled); | ||
4728 | // we are going to tell rest of code about physics so better have this here | 4738 | // we are going to tell rest of code about physics so better have this here |
4729 | PhysActor = pa; | 4739 | PhysActor = pa; |
4730 | 4740 | ||
@@ -4800,6 +4810,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
4800 | 4810 | ||
4801 | ParentGroup.Scene.EventManager.TriggerObjectRemovedFromPhysicalScene(this); | 4811 | ParentGroup.Scene.EventManager.TriggerObjectRemovedFromPhysicalScene(this); |
4802 | } | 4812 | } |
4813 | RemFlag(PrimFlags.CameraDecoupled); | ||
4803 | PhysActor = null; | 4814 | PhysActor = null; |
4804 | } | 4815 | } |
4805 | 4816 | ||
@@ -5021,7 +5032,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
5021 | } | 5032 | } |
5022 | 5033 | ||
5023 | 5034 | ||
5024 | private void UpdatePhysicsSubscribedEvents() | 5035 | internal void UpdatePhysicsSubscribedEvents() |
5025 | { | 5036 | { |
5026 | PhysicsActor pa = PhysActor; | 5037 | PhysicsActor pa = PhysActor; |
5027 | if (pa == null) | 5038 | if (pa == null) |
@@ -5095,8 +5106,6 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
5095 | objectflagupdate |= (uint) PrimFlags.AllowInventoryDrop; | 5106 | objectflagupdate |= (uint) PrimFlags.AllowInventoryDrop; |
5096 | } | 5107 | } |
5097 | 5108 | ||
5098 | UpdatePhysicsSubscribedEvents(); | ||
5099 | |||
5100 | LocalFlags = (PrimFlags)objectflagupdate; | 5109 | LocalFlags = (PrimFlags)objectflagupdate; |
5101 | 5110 | ||
5102 | if (ParentGroup != null && ParentGroup.RootPart == this) | 5111 | if (ParentGroup != null && ParentGroup.RootPart == this) |
@@ -5107,6 +5116,7 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
5107 | { | 5116 | { |
5108 | // m_log.DebugFormat( | 5117 | // m_log.DebugFormat( |
5109 | // "[SCENE OBJECT PART]: Scheduling part {0} {1} for full update in aggregateScriptEvents()", Name, LocalId); | 5118 | // "[SCENE OBJECT PART]: Scheduling part {0} {1} for full update in aggregateScriptEvents()", Name, LocalId); |
5119 | UpdatePhysicsSubscribedEvents(); | ||
5110 | ScheduleFullUpdate(); | 5120 | ScheduleFullUpdate(); |
5111 | } | 5121 | } |
5112 | } | 5122 | } |
@@ -5408,5 +5418,24 @@ SendFullUpdateToClient(remoteClient, Position) ignores position parameter | |||
5408 | Acceleration = Vector3.Zero; | 5418 | Acceleration = Vector3.Zero; |
5409 | APIDActive = false; | 5419 | APIDActive = false; |
5410 | } | 5420 | } |
5421 | |||
5422 | // handle osVolumeDetect | ||
5423 | public void ScriptSetVolumeDetect(bool makeVolumeDetect) | ||
5424 | { | ||
5425 | if(_parentID == 0) | ||
5426 | { | ||
5427 | // if root prim do it via SOG | ||
5428 | ParentGroup.ScriptSetVolumeDetect(makeVolumeDetect); | ||
5429 | return; | ||
5430 | } | ||
5431 | |||
5432 | bool wasUsingPhysics = ((Flags & PrimFlags.Physics) != 0); | ||
5433 | bool wasTemporary = ((Flags & PrimFlags.TemporaryOnRez) != 0); | ||
5434 | bool wasPhantom = ((Flags & PrimFlags.Phantom) != 0); | ||
5435 | |||
5436 | if(PhysActor != null) | ||
5437 | PhysActor.Building = true; | ||
5438 | UpdatePrimFlags(wasUsingPhysics,wasTemporary,wasPhantom,makeVolumeDetect,false); | ||
5439 | } | ||
5411 | } | 5440 | } |
5412 | } | 5441 | } |