[Opensim-dev] IRegisterInterface for extending scene entities

Adams, Robert robert.adams at intel.com
Fri Dec 28 07:38:37 UTC 2012


The discussion about the implementation of the llKeyframeMotion function hinted at a need for region modules to be able to add data and functions to existing scene items. Here is a modest proposal for discussion[1].

Define a general module/interface registration interface to add to EntityBase (and thus to SceneObjectGroup and ScenePresence).

IRegisterInterface
               Void RegisterInterface<T>(T iface);
               Bool TryGet<T>(out T iface);
               T Get<T>();
               Void ClearRegisteredInterfaces();

Any class that implements the IRegisterInterface interface would contain a:
               Private Dictionary<Type, object> m_registeredInterfaces = new Dictionary<Type, object>();

'Scene' already has a RegisterModule interface which has a bunch of neat features (like being able to register multiple instances of the same interface type) but I'm not sure that is needed here (discussion?) Particularly industrious changing could merge this proposed interface and the existing 'Scene' functions.

So, something like a llKeyframeMotion implementing region module could register a KeyframeMotionState type structure on the SOG to save information about the keyframe for that SOG. Other uses could be a uniform way for adding classes of functionality to scene objects ("get me the interface for extracting the physical mesh for this SOG") or just adding limpet like code to a scene entity.

Not sure of the nuances of serialization. I believe that the registered interfaces would just be serialized with the SOG (thus saving and restoring the values in the registered interface instances) but I can't be totally sure of that.

Anyway, run your sword through this strawman.

-- ra

[1] This is similar to other interfaced proposed in the past (particularly one by Adam Frizby).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://opensimulator.org/pipermail/opensim-dev/attachments/20121228/d401623d/attachment-0001.html>


More information about the Opensim-dev mailing list