mirror of
https://github.com/opensim/opensim.git
synced 2026-08-10 19:36:07 +08:00
Merge branch 'master' into careminster
Conflicts: OpenSim/Region/Framework/Scenes/SceneObjectPart.cs
This commit is contained in:
@@ -49,7 +49,7 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
bool CreateStore(string value, ref UUID result);
|
||||
bool DestroyStore(UUID storeID);
|
||||
|
||||
JsonStoreNodeType PathType(UUID storeID, string path);
|
||||
JsonStoreNodeType GetPathType(UUID storeID, string path);
|
||||
bool TestStore(UUID storeID);
|
||||
bool TestPath(UUID storeID, string path, bool useJson);
|
||||
|
||||
@@ -60,6 +60,6 @@ namespace OpenSim.Region.Framework.Interfaces
|
||||
void TakeValue(UUID storeID, string path, bool useJson, TakeValueCallback cback);
|
||||
void ReadValue(UUID storeID, string path, bool useJson, TakeValueCallback cback);
|
||||
|
||||
int ArrayLength(UUID storeID, string path);
|
||||
int GetArrayLength(UUID storeID, string path);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -791,6 +791,19 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
/// <param name="obj">The object being removed from the scene</param>
|
||||
public delegate void ObjectBeingRemovedFromScene(SceneObjectGroup obj);
|
||||
|
||||
/// <summary>
|
||||
/// Triggered when an object is placed into the physical scene (PhysicsActor created).
|
||||
/// </summary>
|
||||
public event Action<SceneObjectPart> OnObjectAddedToPhysicalScene;
|
||||
/// <summary>
|
||||
/// Triggered when an object is removed from the physical scene (PhysicsActor destroyed).
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// Note: this is triggered just before the PhysicsActor is removed from the
|
||||
/// physics engine so the receiver can do any necessary cleanup before its destruction.
|
||||
/// </remarks>
|
||||
public event Action<SceneObjectPart> OnObjectRemovedFromPhysicalScene;
|
||||
|
||||
/// <summary>
|
||||
/// Triggered when an object is removed from the scene.
|
||||
/// </summary>
|
||||
@@ -1541,6 +1554,48 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
}
|
||||
|
||||
public void TriggerObjectAddedToPhysicalScene(SceneObjectPart obj)
|
||||
{
|
||||
Action<SceneObjectPart> handler = OnObjectAddedToPhysicalScene;
|
||||
if (handler != null)
|
||||
{
|
||||
foreach (Action<SceneObjectPart> d in handler.GetInvocationList())
|
||||
{
|
||||
try
|
||||
{
|
||||
d(obj);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[EVENT MANAGER]: Delegate for TriggerObjectAddedToPhysicalScene failed - continuing. {0} {1}",
|
||||
e.Message, e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void TriggerObjectRemovedFromPhysicalScene(SceneObjectPart obj)
|
||||
{
|
||||
Action<SceneObjectPart> handler = OnObjectRemovedFromPhysicalScene;
|
||||
if (handler != null)
|
||||
{
|
||||
foreach (Action<SceneObjectPart> d in handler.GetInvocationList())
|
||||
{
|
||||
try
|
||||
{
|
||||
d(obj);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
m_log.ErrorFormat(
|
||||
"[EVENT MANAGER]: Delegate for TriggerObjectRemovedFromPhysicalScene failed - continuing. {0} {1}",
|
||||
e.Message, e.StackTrace);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void TriggerShutdown()
|
||||
{
|
||||
Action handlerShutdown = OnShutdown;
|
||||
|
||||
@@ -4738,7 +4738,9 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
}
|
||||
|
||||
PhysActor = pa;
|
||||
}
|
||||
|
||||
ParentGroup.Scene.EventManager.TriggerObjectAddedToPhysicalScene(this);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This removes the part from the physics scene.
|
||||
@@ -4757,6 +4759,8 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
pa.OnOutOfBounds -= PhysicsOutOfBounds;
|
||||
|
||||
ParentGroup.Scene.PhysicsScene.RemovePrim(pa);
|
||||
|
||||
ParentGroup.Scene.EventManager.TriggerObjectRemovedFromPhysicalScene(this);
|
||||
}
|
||||
PhysActor = null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user