[Opensim-dev] IRegisterInterface for extending scene entities

Melanie melanie at t-data.com
Fri Dec 28 08:43:35 UTC 2012


Hi,

first off, extending scene entities is a Good Thing. I'll think a
bit about the ins and outs of it and the caveats (for instance,
module load order will have some hidden traps for the unwary) and
serialization - well, there be dragons, you can't serialize module
refs/interfaces since the destination may not have them.....

llSetKeyfranedMotion can most likely not be implemented that way. We
know, because we have implemented it. Also, there is no need to
reinvent the wheel - llSetKeyframedMotion has been slated for core
release for a while now, we just haven't found the dev time to
extract it. So there is really no need for a second, competing
implementation.

So, in summary

+1 on extension points for scene entities

-0 on a second implementation of llSetKeyframedMotion as a tested
and working one already exists.

That's -0 because of you really want it I won't kee you from doing
it - it's just a waste of effort.

Melanie

On 28/12/2012 08:38, Adams, Robert wrote:
> 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).
> 
> 
> 
> 
> _______________________________________________
> Opensim-dev mailing list
> Opensim-dev at lists.berlios.de
> https://lists.berlios.de/mailman/listinfo/opensim-dev



More information about the Opensim-dev mailing list