From: Charles L. <ch...@cn...> - 2009-07-04 05:56:32
|
Devs, I'm looking into adding a way for nodes to be indexable globally and locally. In HG1, we were able to say OBJECTREGISTER.GetObjectByName( "MyCameraControl" ); And it would return a pointer to the object "MyCameraControl." Also, we were able to, if need be, get a list of all of the objects. In HG2, I feel like it would be useful to be able to have the same functionality there. Maybe, all objects could be indexed by name. Also, HG2 could have an additional feature (This is actually what I want first): Another function, to say GetChildByName( "NameOfObject" ); That could search a current node's children and its children's children for that node. This function could/should be asymptotically slower than the overall object register. This would leave us to implement two things: 1) OBJECTREGISTER (using an std::map<> or an MHash) 2) GetChildByName function added to MercuryNode. I could implement both. My only concern with #1 is it does add to the overhead of objects if they have to register with some central command, so-to-speak. We could avoid this by making it so only named objects register with OBJECTREGISTER. This does remove the feature of being able to get a list of all objects, but I am not really sure what the right tradeoff here is... Charles Lohr |