aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
diff options
context:
space:
mode:
authorMelanie2012-03-31 02:18:02 +0100
committerMelanie2012-03-31 02:18:02 +0100
commitf3132c45d98af7bb38251ad95013c433b5eda9e5 (patch)
treeefc3d6c0529678c0a56f5a505a52944012ea607a /OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
parentMerge branch 'master' into careminster (diff)
parentrefactor: Rename SOG.GetChildPart() to GetPart() since it can also return the... (diff)
downloadopensim-SC_OLD-f3132c45d98af7bb38251ad95013c433b5eda9e5.zip
opensim-SC_OLD-f3132c45d98af7bb38251ad95013c433b5eda9e5.tar.gz
opensim-SC_OLD-f3132c45d98af7bb38251ad95013c433b5eda9e5.tar.bz2
opensim-SC_OLD-f3132c45d98af7bb38251ad95013c433b5eda9e5.tar.xz
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/CoreModules/Framework/InventoryAccess/InventoryAccessModule.cs OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs OpenSim/Tests/Common/Mock/TestClient.cs
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs')
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs88
1 files changed, 39 insertions, 49 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 90ad098..11fd721 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -412,6 +412,24 @@ namespace OpenSim.Region.Framework.Scenes
412 return m_parts.ContainsKey(partID); 412 return m_parts.ContainsKey(partID);
413 } 413 }
414 414
415 /// <summary>
416 /// Does this group contain the given part?
417 /// should be able to remove these methods once we have a entity index in scene
418 /// </summary>
419 /// <param name="localID"></param>
420 /// <returns></returns>
421 public bool ContainsPart(uint localID)
422 {
423 SceneObjectPart[] parts = m_parts.GetArray();
424 for (int i = 0; i < parts.Length; i++)
425 {
426 if (parts[i].LocalId == localID)
427 return true;
428 }
429
430 return false;
431 }
432
415 /// <value> 433 /// <value>
416 /// The root part of this scene object 434 /// The root part of this scene object
417 /// </value> 435 /// </value>
@@ -1636,7 +1654,7 @@ namespace OpenSim.Region.Framework.Scenes
1636 1654
1637 public UUID GetPartsFullID(uint localID) 1655 public UUID GetPartsFullID(uint localID)
1638 { 1656 {
1639 SceneObjectPart part = GetChildPart(localID); 1657 SceneObjectPart part = GetPart(localID);
1640 if (part != null) 1658 if (part != null)
1641 { 1659 {
1642 return part.UUID; 1660 return part.UUID;
@@ -1652,7 +1670,7 @@ namespace OpenSim.Region.Framework.Scenes
1652 } 1670 }
1653 else 1671 else
1654 { 1672 {
1655 SceneObjectPart part = GetChildPart(localId); 1673 SceneObjectPart part = GetPart(localId);
1656 OnGrabPart(part, offsetPos, remoteClient); 1674 OnGrabPart(part, offsetPos, remoteClient);
1657 } 1675 }
1658 } 1676 }
@@ -2513,8 +2531,8 @@ namespace OpenSim.Region.Framework.Scenes
2513 /// Get a part with a given UUID 2531 /// Get a part with a given UUID
2514 /// </summary> 2532 /// </summary>
2515 /// <param name="primID"></param> 2533 /// <param name="primID"></param>
2516 /// <returns>null if a child part with the primID was not found</returns> 2534 /// <returns>null if a part with the primID was not found</returns>
2517 public SceneObjectPart GetChildPart(UUID primID) 2535 public SceneObjectPart GetPart(UUID primID)
2518 { 2536 {
2519 SceneObjectPart childPart; 2537 SceneObjectPart childPart;
2520 m_parts.TryGetValue(primID, out childPart); 2538 m_parts.TryGetValue(primID, out childPart);
@@ -2525,8 +2543,8 @@ namespace OpenSim.Region.Framework.Scenes
2525 /// Get a part with a given local ID 2543 /// Get a part with a given local ID
2526 /// </summary> 2544 /// </summary>
2527 /// <param name="localID"></param> 2545 /// <param name="localID"></param>
2528 /// <returns>null if a child part with the local ID was not found</returns> 2546 /// <returns>null if a part with the local ID was not found</returns>
2529 public SceneObjectPart GetChildPart(uint localID) 2547 public SceneObjectPart GetPart(uint localID)
2530 { 2548 {
2531 SceneObjectPart[] parts = m_parts.GetArray(); 2549 SceneObjectPart[] parts = m_parts.GetArray();
2532 for (int i = 0; i < parts.Length; i++) 2550 for (int i = 0; i < parts.Length; i++)
@@ -2538,35 +2556,6 @@ namespace OpenSim.Region.Framework.Scenes
2538 return null; 2556 return null;
2539 } 2557 }
2540 2558
2541 /// <summary>
2542 /// Does this group contain the child prim
2543 /// should be able to remove these methods once we have a entity index in scene
2544 /// </summary>
2545 /// <param name="primID"></param>
2546 /// <returns></returns>
2547 public bool HasChildPrim(UUID primID)
2548 {
2549 return m_parts.ContainsKey(primID);
2550 }
2551
2552 /// <summary>
2553 /// Does this group contain the child prim
2554 /// should be able to remove these methods once we have a entity index in scene
2555 /// </summary>
2556 /// <param name="localID"></param>
2557 /// <returns></returns>
2558 public bool HasChildPrim(uint localID)
2559 {
2560 SceneObjectPart[] parts = m_parts.GetArray();
2561 for (int i = 0; i < parts.Length; i++)
2562 {
2563 if (parts[i].LocalId == localID)
2564 return true;
2565 }
2566
2567 return false;
2568 }
2569
2570 #endregion 2559 #endregion
2571 2560
2572 #region Packet Handlers 2561 #region Packet Handlers
@@ -2720,7 +2709,7 @@ namespace OpenSim.Region.Framework.Scenes
2720 /// <returns>The object group of the newly delinked prim. Null if part could not be found</returns> 2709 /// <returns>The object group of the newly delinked prim. Null if part could not be found</returns>
2721 public SceneObjectGroup DelinkFromGroup(uint partID, bool sendEvents) 2710 public SceneObjectGroup DelinkFromGroup(uint partID, bool sendEvents)
2722 { 2711 {
2723 SceneObjectPart linkPart = GetChildPart(partID); 2712 SceneObjectPart linkPart = GetPart(partID);
2724 2713
2725 if (linkPart != null) 2714 if (linkPart != null)
2726 { 2715 {
@@ -3024,7 +3013,7 @@ namespace OpenSim.Region.Framework.Scenes
3024 /// <param name="localID"></param> 3013 /// <param name="localID"></param>
3025 public void SetPartName(string name, uint localID) 3014 public void SetPartName(string name, uint localID)
3026 { 3015 {
3027 SceneObjectPart part = GetChildPart(localID); 3016 SceneObjectPart part = GetPart(localID);
3028 if (part != null) 3017 if (part != null)
3029 { 3018 {
3030 part.Name = name; 3019 part.Name = name;
@@ -3033,7 +3022,7 @@ namespace OpenSim.Region.Framework.Scenes
3033 3022
3034 public void SetPartDescription(string des, uint localID) 3023 public void SetPartDescription(string des, uint localID)
3035 { 3024 {
3036 SceneObjectPart part = GetChildPart(localID); 3025 SceneObjectPart part = GetPart(localID);
3037 if (part != null) 3026 if (part != null)
3038 { 3027 {
3039 part.Description = des; 3028 part.Description = des;
@@ -3042,7 +3031,7 @@ namespace OpenSim.Region.Framework.Scenes
3042 3031
3043 public void SetPartText(string text, uint localID) 3032 public void SetPartText(string text, uint localID)
3044 { 3033 {
3045 SceneObjectPart part = GetChildPart(localID); 3034 SceneObjectPart part = GetPart(localID);
3046 if (part != null) 3035 if (part != null)
3047 { 3036 {
3048 part.SetText(text); 3037 part.SetText(text);
@@ -3051,7 +3040,7 @@ namespace OpenSim.Region.Framework.Scenes
3051 3040
3052 public void SetPartText(string text, UUID partID) 3041 public void SetPartText(string text, UUID partID)
3053 { 3042 {
3054 SceneObjectPart part = GetChildPart(partID); 3043 SceneObjectPart part = GetPart(partID);
3055 if (part != null) 3044 if (part != null)
3056 { 3045 {
3057 part.SetText(text); 3046 part.SetText(text);
@@ -3060,7 +3049,7 @@ namespace OpenSim.Region.Framework.Scenes
3060 3049
3061 public string GetPartName(uint localID) 3050 public string GetPartName(uint localID)
3062 { 3051 {
3063 SceneObjectPart part = GetChildPart(localID); 3052 SceneObjectPart part = GetPart(localID);
3064 if (part != null) 3053 if (part != null)
3065 { 3054 {
3066 return part.Name; 3055 return part.Name;
@@ -3070,7 +3059,7 @@ namespace OpenSim.Region.Framework.Scenes
3070 3059
3071 public string GetPartDescription(uint localID) 3060 public string GetPartDescription(uint localID)
3072 { 3061 {
3073 SceneObjectPart part = GetChildPart(localID); 3062 SceneObjectPart part = GetPart(localID);
3074 if (part != null) 3063 if (part != null)
3075 { 3064 {
3076 return part.Description; 3065 return part.Description;
@@ -3088,7 +3077,7 @@ namespace OpenSim.Region.Framework.Scenes
3088 /// <param name="SetVolumeDetect"></param> 3077 /// <param name="SetVolumeDetect"></param>
3089 public void UpdatePrimFlags(uint localID, bool UsePhysics, bool SetTemporary, bool SetPhantom, bool SetVolumeDetect) 3078 public void UpdatePrimFlags(uint localID, bool UsePhysics, bool SetTemporary, bool SetPhantom, bool SetVolumeDetect)
3090 { 3079 {
3091 SceneObjectPart selectionPart = GetChildPart(localID); 3080 SceneObjectPart selectionPart = GetPart(localID);
3092 3081
3093 if (SetTemporary && Scene != null) 3082 if (SetTemporary && Scene != null)
3094 { 3083 {
@@ -3148,7 +3137,7 @@ namespace OpenSim.Region.Framework.Scenes
3148 3137
3149 public void UpdateExtraParam(uint localID, ushort type, bool inUse, byte[] data) 3138 public void UpdateExtraParam(uint localID, ushort type, bool inUse, byte[] data)
3150 { 3139 {
3151 SceneObjectPart part = GetChildPart(localID); 3140 SceneObjectPart part = GetPart(localID);
3152 if (part != null) 3141 if (part != null)
3153 { 3142 {
3154 part.UpdateExtraParam(type, inUse, data); 3143 part.UpdateExtraParam(type, inUse, data);
@@ -3173,7 +3162,7 @@ namespace OpenSim.Region.Framework.Scenes
3173 /// <param name="textureEntry"></param> 3162 /// <param name="textureEntry"></param>
3174 public void UpdateTextureEntry(uint localID, byte[] textureEntry) 3163 public void UpdateTextureEntry(uint localID, byte[] textureEntry)
3175 { 3164 {
3176 SceneObjectPart part = GetChildPart(localID); 3165 SceneObjectPart part = GetPart(localID);
3177 if (part != null) 3166 if (part != null)
3178 { 3167 {
3179 part.UpdateTextureEntry(textureEntry); 3168 part.UpdateTextureEntry(textureEntry);
@@ -3205,7 +3194,7 @@ namespace OpenSim.Region.Framework.Scenes
3205 /// <param name="shapeBlock"></param> 3194 /// <param name="shapeBlock"></param>
3206 public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock, uint localID) 3195 public void UpdateShape(ObjectShapePacket.ObjectDataBlock shapeBlock, uint localID)
3207 { 3196 {
3208 SceneObjectPart part = GetChildPart(localID); 3197 SceneObjectPart part = GetPart(localID);
3209 if (part != null) 3198 if (part != null)
3210 { 3199 {
3211 part.UpdateShape(shapeBlock); 3200 part.UpdateShape(shapeBlock);
@@ -3395,7 +3384,7 @@ namespace OpenSim.Region.Framework.Scenes
3395 3384
3396 public void UpdateSinglePosition(Vector3 pos, uint localID) 3385 public void UpdateSinglePosition(Vector3 pos, uint localID)
3397 { 3386 {
3398 SceneObjectPart part = GetChildPart(localID); 3387 SceneObjectPart part = GetPart(localID);
3399 3388
3400 if (part != null) 3389 if (part != null)
3401 { 3390 {
@@ -3508,7 +3497,8 @@ namespace OpenSim.Region.Framework.Scenes
3508 /// <param name="localID"></param> 3497 /// <param name="localID"></param>
3509 public void UpdateSingleRotation(Quaternion rot, uint localID) 3498 public void UpdateSingleRotation(Quaternion rot, uint localID)
3510 { 3499 {
3511 SceneObjectPart part = GetChildPart(localID); 3500 SceneObjectPart part = GetPart(localID);
3501
3512 SceneObjectPart[] parts = m_parts.GetArray(); 3502 SceneObjectPart[] parts = m_parts.GetArray();
3513 3503
3514 if (part != null) 3504 if (part != null)
@@ -3537,7 +3527,7 @@ namespace OpenSim.Region.Framework.Scenes
3537 /// <param name="localID"></param> 3527 /// <param name="localID"></param>
3538 public void UpdateSingleRotation(Quaternion rot, Vector3 pos, uint localID) 3528 public void UpdateSingleRotation(Quaternion rot, Vector3 pos, uint localID)
3539 { 3529 {
3540 SceneObjectPart part = GetChildPart(localID); 3530 SceneObjectPart part = GetPart(localID);
3541 if (part != null) 3531 if (part != null)
3542 { 3532 {
3543 if (m_rootPart.PhysActor != null) 3533 if (m_rootPart.PhysActor != null)