diff options
Diffstat (limited to 'OpenSim/Region/Environment/Scenes/SceneGraph.cs')
-rw-r--r-- | OpenSim/Region/Environment/Scenes/SceneGraph.cs | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/OpenSim/Region/Environment/Scenes/SceneGraph.cs b/OpenSim/Region/Environment/Scenes/SceneGraph.cs index 8476344..26fe40a 100644 --- a/OpenSim/Region/Environment/Scenes/SceneGraph.cs +++ b/OpenSim/Region/Environment/Scenes/SceneGraph.cs | |||
@@ -39,6 +39,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
39 | { | 39 | { |
40 | public delegate void PhysicsCrash(); | 40 | public delegate void PhysicsCrash(); |
41 | 41 | ||
42 | public delegate void ObjectDuplicateDelegate(EntityBase original, EntityBase clone); | ||
43 | |||
44 | public delegate void ObjectCreateDelegate(EntityBase obj); | ||
45 | |||
46 | public delegate void ObjectDeleteDelegate(EntityBase obj); | ||
47 | |||
42 | /// <summary> | 48 | /// <summary> |
43 | /// This class used to be called InnerScene and may not yet truly be a SceneGraph. The non scene graph components | 49 | /// This class used to be called InnerScene and may not yet truly be a SceneGraph. The non scene graph components |
44 | /// should be migrated out over time. | 50 | /// should be migrated out over time. |
@@ -52,6 +58,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
52 | protected internal event PhysicsCrash UnRecoverableError; | 58 | protected internal event PhysicsCrash UnRecoverableError; |
53 | private PhysicsCrash handlerPhysicsCrash = null; | 59 | private PhysicsCrash handlerPhysicsCrash = null; |
54 | 60 | ||
61 | public event ObjectDuplicateDelegate OnObjectDuplicate; | ||
62 | public event ObjectCreateDelegate OnObjectCreate; | ||
63 | public event ObjectDeleteDelegate OnObjectRemove; | ||
64 | |||
55 | #endregion | 65 | #endregion |
56 | 66 | ||
57 | #region Fields | 67 | #region Fields |
@@ -288,6 +298,9 @@ namespace OpenSim.Region.Environment.Scenes | |||
288 | if (attachToBackup) | 298 | if (attachToBackup) |
289 | sceneObject.AttachToBackup(); | 299 | sceneObject.AttachToBackup(); |
290 | 300 | ||
301 | if (OnObjectCreate != null) | ||
302 | OnObjectCreate(sceneObject); | ||
303 | |||
291 | return true; | 304 | return true; |
292 | } | 305 | } |
293 | } | 306 | } |
@@ -313,12 +326,12 @@ namespace OpenSim.Region.Environment.Scenes | |||
313 | } | 326 | } |
314 | } | 327 | } |
315 | 328 | ||
316 | 329 | if (OnObjectRemove != null) | |
330 | OnObjectRemove(Entities[uuid]); | ||
317 | 331 | ||
318 | Entities.Remove(uuid); | 332 | Entities.Remove(uuid); |
319 | //SceneObjectGroup part; | 333 | //SceneObjectGroup part; |
320 | //((part.RootPart.Flags & PrimFlags.Physics) == PrimFlags.Physics) | 334 | //((part.RootPart.Flags & PrimFlags.Physics) == PrimFlags.Physics) |
321 | |||
322 | 335 | ||
323 | return true; | 336 | return true; |
324 | } | 337 | } |
@@ -1694,7 +1707,7 @@ namespace OpenSim.Region.Environment.Scenes | |||
1694 | protected internal SceneObjectGroup DuplicateObject(uint originalPrim, Vector3 offset, uint flags, UUID AgentID, UUID GroupID, Quaternion rot) | 1707 | protected internal SceneObjectGroup DuplicateObject(uint originalPrim, Vector3 offset, uint flags, UUID AgentID, UUID GroupID, Quaternion rot) |
1695 | { | 1708 | { |
1696 | //m_log.DebugFormat("[SCENE]: Duplication of object {0} at offset {1} requested by agent {2}", originalPrim, offset, AgentID); | 1709 | //m_log.DebugFormat("[SCENE]: Duplication of object {0} at offset {1} requested by agent {2}", originalPrim, offset, AgentID); |
1697 | 1710 | ||
1698 | List<EntityBase> EntityList = GetEntities(); | 1711 | List<EntityBase> EntityList = GetEntities(); |
1699 | 1712 | ||
1700 | SceneObjectGroup originPrim = null; | 1713 | SceneObjectGroup originPrim = null; |
@@ -1739,6 +1752,10 @@ namespace OpenSim.Region.Environment.Scenes | |||
1739 | 1752 | ||
1740 | // required for physics to update it's position | 1753 | // required for physics to update it's position |
1741 | copy.AbsolutePosition = copy.AbsolutePosition; | 1754 | copy.AbsolutePosition = copy.AbsolutePosition; |
1755 | |||
1756 | if (OnObjectDuplicate != null) | ||
1757 | OnObjectDuplicate(originPrim, copy); | ||
1758 | |||
1742 | return copy; | 1759 | return copy; |
1743 | } | 1760 | } |
1744 | } | 1761 | } |