diff options
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 26 | ||||
-rw-r--r-- | OpenSim/Region/Framework/Scenes/SceneGraph.cs | 16 |
2 files changed, 22 insertions, 20 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index bbd2163..186e01c 100644 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2716,7 +2716,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2716 | client.OnObjectMaterial += m_sceneGraph.PrimMaterial; | 2716 | client.OnObjectMaterial += m_sceneGraph.PrimMaterial; |
2717 | client.OnLinkObjects += LinkObjects; | 2717 | client.OnLinkObjects += LinkObjects; |
2718 | client.OnDelinkObjects += DelinkObjects; | 2718 | client.OnDelinkObjects += DelinkObjects; |
2719 | client.OnObjectDuplicate += m_sceneGraph.DuplicateObject; | 2719 | client.OnObjectDuplicate += DuplicateObject; |
2720 | client.OnObjectDuplicateOnRay += doObjectDuplicateOnRay; | 2720 | client.OnObjectDuplicateOnRay += doObjectDuplicateOnRay; |
2721 | client.OnUpdatePrimFlags += m_sceneGraph.UpdatePrimFlags; | 2721 | client.OnUpdatePrimFlags += m_sceneGraph.UpdatePrimFlags; |
2722 | client.OnRequestObjectPropertiesFamily += m_sceneGraph.RequestObjectPropertiesFamily; | 2722 | client.OnRequestObjectPropertiesFamily += m_sceneGraph.RequestObjectPropertiesFamily; |
@@ -2843,7 +2843,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2843 | client.OnObjectMaterial -= m_sceneGraph.PrimMaterial; | 2843 | client.OnObjectMaterial -= m_sceneGraph.PrimMaterial; |
2844 | client.OnLinkObjects -= LinkObjects; | 2844 | client.OnLinkObjects -= LinkObjects; |
2845 | client.OnDelinkObjects -= DelinkObjects; | 2845 | client.OnDelinkObjects -= DelinkObjects; |
2846 | client.OnObjectDuplicate -= m_sceneGraph.DuplicateObject; | 2846 | client.OnObjectDuplicate -= DuplicateObject; |
2847 | client.OnObjectDuplicateOnRay -= doObjectDuplicateOnRay; | 2847 | client.OnObjectDuplicateOnRay -= doObjectDuplicateOnRay; |
2848 | client.OnUpdatePrimFlags -= m_sceneGraph.UpdatePrimFlags; | 2848 | client.OnUpdatePrimFlags -= m_sceneGraph.UpdatePrimFlags; |
2849 | client.OnRequestObjectPropertiesFamily -= m_sceneGraph.RequestObjectPropertiesFamily; | 2849 | client.OnRequestObjectPropertiesFamily -= m_sceneGraph.RequestObjectPropertiesFamily; |
@@ -2936,6 +2936,21 @@ namespace OpenSim.Region.Framework.Scenes | |||
2936 | } | 2936 | } |
2937 | 2937 | ||
2938 | /// <summary> | 2938 | /// <summary> |
2939 | /// Duplicates object specified by localID. This is the event handler for IClientAPI. | ||
2940 | /// </summary> | ||
2941 | /// <param name="originalPrim">ID of object to duplicate</param> | ||
2942 | /// <param name="offset"></param> | ||
2943 | /// <param name="flags"></param> | ||
2944 | /// <param name="AgentID">Agent doing the duplication</param> | ||
2945 | /// <param name="GroupID">Group of new object</param> | ||
2946 | public void DuplicateObject(uint originalPrim, Vector3 offset, uint flags, UUID AgentID, UUID GroupID) | ||
2947 | { | ||
2948 | SceneObjectGroup copy = SceneGraph.DuplicateObject(originalPrim, offset, flags, AgentID, GroupID, Quaternion.Identity); | ||
2949 | if (copy != null) | ||
2950 | EventManager.TriggerObjectAddedToScene(copy); | ||
2951 | } | ||
2952 | |||
2953 | /// <summary> | ||
2939 | /// Duplicates object specified by localID at position raycasted against RayTargetObject using | 2954 | /// Duplicates object specified by localID at position raycasted against RayTargetObject using |
2940 | /// RayEnd and RayStart to determine what the angle of the ray is | 2955 | /// RayEnd and RayStart to determine what the angle of the ray is |
2941 | /// </summary> | 2956 | /// </summary> |
@@ -2997,19 +3012,22 @@ namespace OpenSim.Region.Framework.Scenes | |||
2997 | 3012 | ||
2998 | // stick in offset format from the original prim | 3013 | // stick in offset format from the original prim |
2999 | pos = pos - target.ParentGroup.AbsolutePosition; | 3014 | pos = pos - target.ParentGroup.AbsolutePosition; |
3015 | SceneObjectGroup copy; | ||
3000 | if (CopyRotates) | 3016 | if (CopyRotates) |
3001 | { | 3017 | { |
3002 | Quaternion worldRot = target2.GetWorldRotation(); | 3018 | Quaternion worldRot = target2.GetWorldRotation(); |
3003 | 3019 | ||
3004 | // SceneObjectGroup obj = m_sceneGraph.DuplicateObject(localID, pos, target.GetEffectiveObjectFlags(), AgentID, GroupID, worldRot); | 3020 | // SceneObjectGroup obj = m_sceneGraph.DuplicateObject(localID, pos, target.GetEffectiveObjectFlags(), AgentID, GroupID, worldRot); |
3005 | m_sceneGraph.DuplicateObject(localID, pos, target.GetEffectiveObjectFlags(), AgentID, GroupID, worldRot); | 3021 | copy = m_sceneGraph.DuplicateObject(localID, pos, target.GetEffectiveObjectFlags(), AgentID, GroupID, worldRot); |
3006 | //obj.Rotation = worldRot; | 3022 | //obj.Rotation = worldRot; |
3007 | //obj.UpdateGroupRotationR(worldRot); | 3023 | //obj.UpdateGroupRotationR(worldRot); |
3008 | } | 3024 | } |
3009 | else | 3025 | else |
3010 | { | 3026 | { |
3011 | m_sceneGraph.DuplicateObject(localID, pos, target.GetEffectiveObjectFlags(), AgentID, GroupID); | 3027 | copy = m_sceneGraph.DuplicateObject(localID, pos, target.GetEffectiveObjectFlags(), AgentID, GroupID, Quaternion.Identity); |
3012 | } | 3028 | } |
3029 | if (copy != null) | ||
3030 | EventManager.TriggerObjectAddedToScene(copy); | ||
3013 | } | 3031 | } |
3014 | } | 3032 | } |
3015 | } | 3033 | } |
diff --git a/OpenSim/Region/Framework/Scenes/SceneGraph.cs b/OpenSim/Region/Framework/Scenes/SceneGraph.cs index 1487fac..7d801b5 100644 --- a/OpenSim/Region/Framework/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Framework/Scenes/SceneGraph.cs | |||
@@ -1873,22 +1873,6 @@ namespace OpenSim.Region.Framework.Scenes | |||
1873 | } | 1873 | } |
1874 | 1874 | ||
1875 | /// <summary> | 1875 | /// <summary> |
1876 | /// Duplicate the given object, Fire and Forget, No rotation, no return wrapper | ||
1877 | /// </summary> | ||
1878 | /// <param name="originalPrim"></param> | ||
1879 | /// <param name="offset"></param> | ||
1880 | /// <param name="flags"></param> | ||
1881 | /// <param name="AgentID"></param> | ||
1882 | /// <param name="GroupID"></param> | ||
1883 | protected internal void DuplicateObject(uint originalPrim, Vector3 offset, uint flags, UUID AgentID, UUID GroupID) | ||
1884 | { | ||
1885 | //m_log.DebugFormat("[SCENE]: Duplication of object {0} at offset {1} requested by agent {2}", originalPrim, offset, AgentID); | ||
1886 | |||
1887 | // SceneObjectGroup dupe = DuplicateObject(originalPrim, offset, flags, AgentID, GroupID, Quaternion.Zero); | ||
1888 | DuplicateObject(originalPrim, offset, flags, AgentID, GroupID, Quaternion.Identity); | ||
1889 | } | ||
1890 | |||
1891 | /// <summary> | ||
1892 | /// Duplicate the given object. | 1876 | /// Duplicate the given object. |
1893 | /// </summary> | 1877 | /// </summary> |
1894 | /// <param name="originalPrim"></param> | 1878 | /// <param name="originalPrim"></param> |