A workable way to copy custom parameters?
Posted: Wed Feb 11, 2009 1:23 pm
Hi there!
I'm currently trying to clone a hierarchy within a scene (i.e. clone a SceneNode with all children and attached objects) and I've encountered a problem: There's no sensible way to copy the custom parameters, because I don't have access to the CustomParameterMap each Renderable has.
The only "solution" I can come up with is to actually iterate over the size_t space and try to get the parameter, catching any exceptions... quite a lot of work when the number of actual parameters is probably significantly lower.
One idea would be to provide a copy of the CustomParameterMap accessible via a function (e.g. map<size_t, Vector4> Renderable::GetCustomParameterMap())... or, if that's impossible for some reason a function that returns a vector / list / whatever containing all used custom parameter indices.
anything wrong with that request?
I'm currently trying to clone a hierarchy within a scene (i.e. clone a SceneNode with all children and attached objects) and I've encountered a problem: There's no sensible way to copy the custom parameters, because I don't have access to the CustomParameterMap each Renderable has.
The only "solution" I can come up with is to actually iterate over the size_t space and try to get the parameter, catching any exceptions... quite a lot of work when the number of actual parameters is probably significantly lower.
One idea would be to provide a copy of the CustomParameterMap accessible via a function (e.g. map<size_t, Vector4> Renderable::GetCustomParameterMap())... or, if that's impossible for some reason a function that returns a vector / list / whatever containing all used custom parameter indices.
anything wrong with that request?