mirror of
https://github.com/opensim/opensim.git
synced 2026-08-06 01:06:30 +08:00
Create the ability for physics modules to request assets on demand by
themselves. For that, the physics module simply calls RequestAssetMethod, which in turn points to Scene.PhysicsRequestAsset. This gives physics access to the asset system without introducing unwanted knowledge of the scene class.
This commit is contained in:
@@ -5421,5 +5421,21 @@ namespace OpenSim.Region.Framework.Scenes
|
||||
m_SpawnPoint = 1;
|
||||
return m_SpawnPoint - 1;
|
||||
}
|
||||
|
||||
// Wrappers to get physics modules retrieve assets. Has to be done this way
|
||||
// because we can't assign the asset service to physics directly - at the
|
||||
// time physics are instantiated it's not registered but it will be by
|
||||
// the time the first prim exists.
|
||||
public void PhysicsRequestAsset(UUID assetID, AssetReceivedDelegate callback)
|
||||
{
|
||||
AssetService.Get(assetID.ToString(), callback, PhysicsAssetReceived);
|
||||
}
|
||||
|
||||
private void PhysicsAssetReceived(string id, Object sender, AssetBase asset)
|
||||
{
|
||||
AssetReceivedDelegate callback = (AssetReceivedDelegate)sender;
|
||||
|
||||
callback(asset);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user