aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework
diff options
context:
space:
mode:
authorMelanie2012-04-23 21:13:08 +0100
committerMelanie2012-04-23 21:13:08 +0100
commit159b3b27ca734ab523c47d2ab65397595b1c0a8e (patch)
tree8038d76c48e48b000e7f96eeade3d335db68daaa /OpenSim/Region/Framework
parentMerge branch 'master' into careminster (diff)
parentubitODE - do own timing control (as chODE does) until heartbeat does it right (diff)
downloadopensim-SC-159b3b27ca734ab523c47d2ab65397595b1c0a8e.zip
opensim-SC-159b3b27ca734ab523c47d2ab65397595b1c0a8e.tar.gz
opensim-SC-159b3b27ca734ab523c47d2ab65397595b1c0a8e.tar.bz2
opensim-SC-159b3b27ca734ab523c47d2ab65397595b1c0a8e.tar.xz
Merge branch 'master' of ssh://melanie@3dhosting.de/var/git/careminster into careminster
Diffstat (limited to 'OpenSim/Region/Framework')
-rw-r--r--OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs66
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs48
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectPart.cs14
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs7
4 files changed, 109 insertions, 26 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
index 36d46b8..cf68ff4 100644
--- a/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
+++ b/OpenSim/Region/Framework/Scenes/Scene.PacketHandlers.cs
@@ -149,27 +149,47 @@ namespace OpenSim.Region.Framework.Scenes
149 /// <param name="remoteClient"></param> 149 /// <param name="remoteClient"></param>
150 public void SelectPrim(uint primLocalID, IClientAPI remoteClient) 150 public void SelectPrim(uint primLocalID, IClientAPI remoteClient)
151 { 151 {
152 /*
153 SceneObjectPart part = GetSceneObjectPart(primLocalID);
154
155 if (null == part)
156 return;
157
158 if (part.IsRoot)
159 {
160 SceneObjectGroup sog = part.ParentGroup;
161 sog.SendPropertiesToClient(remoteClient);
162
163 // A prim is only tainted if it's allowed to be edited by the person clicking it.
164 if (Permissions.CanEditObject(sog.UUID, remoteClient.AgentId)
165 || Permissions.CanMoveObject(sog.UUID, remoteClient.AgentId))
166 {
167 sog.IsSelected = true;
168 EventManager.TriggerParcelPrimCountTainted();
169 }
170 }
171 else
172 {
173 part.SendPropertiesToClient(remoteClient);
174 }
175 */
152 SceneObjectPart part = GetSceneObjectPart(primLocalID); 176 SceneObjectPart part = GetSceneObjectPart(primLocalID);
153 177
154 if (null == part) 178 if (null == part)
155 return; 179 return;
156 180
157 if (part.IsRoot) 181 SceneObjectGroup sog = part.ParentGroup;
158 { 182 if (sog == null)
159 SceneObjectGroup sog = part.ParentGroup; 183 return;
160 sog.SendPropertiesToClient(remoteClient);
161 184
162 // A prim is only tainted if it's allowed to be edited by the person clicking it. 185 part.SendPropertiesToClient(remoteClient);
163 if (Permissions.CanEditObject(sog.UUID, remoteClient.AgentId) 186
164 || Permissions.CanMoveObject(sog.UUID, remoteClient.AgentId)) 187 // A prim is only tainted if it's allowed to be edited by the person clicking it.
165 { 188 if (Permissions.CanEditObject(sog.UUID, remoteClient.AgentId)
166 sog.IsSelected = true; 189 || Permissions.CanMoveObject(sog.UUID, remoteClient.AgentId))
167 EventManager.TriggerParcelPrimCountTainted();
168 }
169 }
170 else
171 { 190 {
172 part.SendPropertiesToClient(remoteClient); 191 part.IsSelected = true;
192 EventManager.TriggerParcelPrimCountTainted();
173 } 193 }
174 } 194 }
175 195
@@ -222,7 +242,7 @@ namespace OpenSim.Region.Framework.Scenes
222 SceneObjectPart part = GetSceneObjectPart(primLocalID); 242 SceneObjectPart part = GetSceneObjectPart(primLocalID);
223 if (part == null) 243 if (part == null)
224 return; 244 return;
225 245 /*
226 // A deselect packet contains all the local prims being deselected. However, since selection is still 246 // A deselect packet contains all the local prims being deselected. However, since selection is still
227 // group based we only want the root prim to trigger a full update - otherwise on objects with many prims 247 // group based we only want the root prim to trigger a full update - otherwise on objects with many prims
228 // we end up sending many duplicate ObjectUpdates 248 // we end up sending many duplicate ObjectUpdates
@@ -257,6 +277,22 @@ namespace OpenSim.Region.Framework.Scenes
257 part.UUID, remoteClient.AgentId)) 277 part.UUID, remoteClient.AgentId))
258 EventManager.TriggerParcelPrimCountTainted(); 278 EventManager.TriggerParcelPrimCountTainted();
259 } 279 }
280 */
281
282 bool oldgprSelect = part.ParentGroup.IsSelected;
283
284 // This is wrong, wrong, wrong. Selection should not be
285 // handled by group, but by prim. Legacy cruft.
286 // TODO: Make selection flagging per prim!
287 //
288 if (Permissions.CanEditObject(part.ParentGroup.UUID, remoteClient.AgentId)
289 || Permissions.CanMoveObject(part.ParentGroup.UUID, remoteClient.AgentId))
290 {
291 part.IsSelected = false;
292 if (!part.ParentGroup.IsAttachment && oldgprSelect != part.ParentGroup.IsSelected)
293 EventManager.TriggerParcelPrimCountTainted();
294 }
295
260 } 296 }
261 297
262 public virtual void ProcessMoneyTransferRequest(UUID source, UUID destination, int amount, 298 public virtual void ProcessMoneyTransferRequest(UUID source, UUID destination, int amount,
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 8717ed1..c47db97 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -726,6 +726,11 @@ namespace OpenSim.Region.Framework.Scenes
726 m_isSelected = value; 726 m_isSelected = value;
727 // Tell physics engine that group is selected 727 // Tell physics engine that group is selected
728 728
729 // this is not right
730 // but ode engines should only really need to know about root part
731 // so they can put entire object simulation on hold and not colliding
732 // keep as was for now
733
729 PhysicsActor pa = m_rootPart.PhysActor; 734 PhysicsActor pa = m_rootPart.PhysActor;
730 if (pa != null) 735 if (pa != null)
731 { 736 {
@@ -747,6 +752,40 @@ namespace OpenSim.Region.Framework.Scenes
747 } 752 }
748 } 753 }
749 754
755 public void PartSelectChanged(bool partSelect)
756 {
757 // any part selected makes group selected
758 if (m_isSelected == partSelect)
759 return;
760
761 if (partSelect)
762 {
763 IsSelected = partSelect;
764// if (!IsAttachment)
765// ScheduleGroupForFullUpdate();
766 }
767 else
768 {
769 // bad bad bad 2 heavy for large linksets
770 // since viewer does send lot of (un)selects
771 // this needs to be replaced by a specific list or count ?
772 // but that will require extra code in several places
773
774 SceneObjectPart[] parts = m_parts.GetArray();
775 for (int i = 0; i < parts.Length; i++)
776 {
777 SceneObjectPart part = parts[i];
778 if (part.IsSelected)
779 return;
780 }
781 IsSelected = partSelect;
782 if (!IsAttachment)
783 {
784 ScheduleGroupForFullUpdate();
785 }
786 }
787 }
788
750 private SceneObjectPart m_PlaySoundMasterPrim = null; 789 private SceneObjectPart m_PlaySoundMasterPrim = null;
751 public SceneObjectPart PlaySoundMasterPrim 790 public SceneObjectPart PlaySoundMasterPrim
752 { 791 {
@@ -3161,14 +3200,6 @@ namespace OpenSim.Region.Framework.Scenes
3161 } 3200 }
3162 } 3201 }
3163 3202
3164/*
3165 RootPart.UpdatePrimFlags(UsePhysics, SetTemporary, SetPhantom, SetVolumeDetect);
3166 for (int i = 0; i < parts.Length; i++)
3167 {
3168 if (parts[i] != RootPart)
3169 parts[i].UpdatePrimFlags(UsePhysics, SetTemporary, SetPhantom, SetVolumeDetect);
3170 }
3171*/
3172 if (parts.Length > 1) 3203 if (parts.Length > 1)
3173 { 3204 {
3174 m_rootPart.UpdatePrimFlags(UsePhysics, SetTemporary, SetPhantom, SetVolumeDetect, true); 3205 m_rootPart.UpdatePrimFlags(UsePhysics, SetTemporary, SetPhantom, SetVolumeDetect, true);
@@ -3185,7 +3216,6 @@ namespace OpenSim.Region.Framework.Scenes
3185 } 3216 }
3186 else 3217 else
3187 m_rootPart.UpdatePrimFlags(UsePhysics, SetTemporary, SetPhantom, SetVolumeDetect, false); 3218 m_rootPart.UpdatePrimFlags(UsePhysics, SetTemporary, SetPhantom, SetVolumeDetect, false);
3188
3189 } 3219 }
3190 } 3220 }
3191 3221
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
index 0f7959d..37b5554 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
@@ -304,6 +304,9 @@ namespace OpenSim.Region.Framework.Scenes
304 protected float m_friction = 0.6f; // wood 304 protected float m_friction = 0.6f; // wood
305 protected float m_bounce = 0.5f; // wood 305 protected float m_bounce = 0.5f; // wood
306 306
307
308 protected bool m_isSelected = false;
309
307 /// <summary> 310 /// <summary>
308 /// Stores media texture data 311 /// Stores media texture data
309 /// </summary> 312 /// </summary>
@@ -577,6 +580,16 @@ namespace OpenSim.Region.Framework.Scenes
577 } 580 }
578 } 581 }
579 582
583 public bool IsSelected
584 {
585 get { return m_isSelected; }
586 set
587 {
588 m_isSelected = value;
589 if (ParentGroup != null)
590 ParentGroup.PartSelectChanged(value);
591 }
592 }
580 593
581 594
582 public Dictionary<int, string> CollisionFilter 595 public Dictionary<int, string> CollisionFilter
@@ -1907,6 +1920,7 @@ namespace OpenSim.Region.Framework.Scenes
1907 dupe.m_rezzed = m_rezzed; 1920 dupe.m_rezzed = m_rezzed;
1908 1921
1909 dupe.m_UndoRedo = null; 1922 dupe.m_UndoRedo = null;
1923 dupe.m_isSelected = false;
1910 1924
1911 dupe.IgnoreUndoUpdate = false; 1925 dupe.IgnoreUndoUpdate = false;
1912 dupe.Undoing = false; 1926 dupe.Undoing = false;
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index ac791ae..f3f03f5 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -753,9 +753,10 @@ namespace OpenSim.Region.Framework.Scenes
753 if (m_movementAnimationUpdateCounter >= 2) 753 if (m_movementAnimationUpdateCounter >= 2)
754 { 754 {
755 m_movementAnimationUpdateCounter = 0; 755 m_movementAnimationUpdateCounter = 0;
756 if (Animator != null && ParentID == 0) // skip it if sitting 756 if (Animator != null)
757 { 757 {
758 Animator.UpdateMovementAnimations(); 758 if(ParentID == 0) // skip it if sitting
759 Animator.UpdateMovementAnimations();
759 } 760 }
760 else 761 else
761 { 762 {
@@ -1400,6 +1401,7 @@ namespace OpenSim.Region.Framework.Scenes
1400 { 1401 {
1401 // Vector3 posAdjusted = m_pos + HEAD_ADJUSTMENT; 1402 // Vector3 posAdjusted = m_pos + HEAD_ADJUSTMENT;
1402 // m_scene.PhysicsScene.RaycastWorld(m_pos, Vector3.Normalize(CameraPosition - posAdjusted), Vector3.Distance(CameraPosition, posAdjusted) + 0.3f, RayCastCameraCallback); 1403 // m_scene.PhysicsScene.RaycastWorld(m_pos, Vector3.Normalize(CameraPosition - posAdjusted), Vector3.Distance(CameraPosition, posAdjusted) + 0.3f, RayCastCameraCallback);
1404
1403 Vector3 posAdjusted = AbsolutePosition + HEAD_ADJUSTMENT; 1405 Vector3 posAdjusted = AbsolutePosition + HEAD_ADJUSTMENT;
1404 Vector3 distTocam = CameraPosition - posAdjusted; 1406 Vector3 distTocam = CameraPosition - posAdjusted;
1405 float distTocamlen = distTocam.Length(); 1407 float distTocamlen = distTocam.Length();
@@ -1408,6 +1410,7 @@ namespace OpenSim.Region.Framework.Scenes
1408 distTocam *= 1.0f / distTocamlen; 1410 distTocam *= 1.0f / distTocamlen;
1409 m_scene.PhysicsScene.RaycastWorld(posAdjusted, distTocam, distTocamlen + 0.3f, RayCastCameraCallback); 1411 m_scene.PhysicsScene.RaycastWorld(posAdjusted, distTocam, distTocamlen + 0.3f, RayCastCameraCallback);
1410 } 1412 }
1413
1411 } 1414 }
1412 } 1415 }
1413 1416