diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Framework/Scenes/Scene.cs | 26 |
1 files changed, 22 insertions, 4 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 | } |