Hi,
Lately I’ve encountered some problem and haven’t found any good solution yet.
What I’m trying to do is to use some structure that cointains pointers to daeTArrays for easier use:
struct Buffers
{
daeTArray<int>* indexBuf;
daeTArray<float>* vertexBuf;
//and so on…
}
So the problem is that those template types are created during compile time just to generate code. I examine the type of data in <source… elements (in <mesh> element):
<mesh>
<source id="geom-Plane1-positions">
<float_array id="geom-Plane1-positions-array" count="18">-0.19685 -0.19685 0 0 -0.19685 0 0.19685 -0.19685 0 -0.19685 0.19685 0 0 0.19685 0 0.19685 0.19685 0</float_array>
<technique_common>
<accessor source="#geom-Plane1-positions-array" count="6" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
As we can see source can have float_array or maybe sometime int_array (can I consider that it always will be a float_array?)? So do I need to generate two structures (or two pointers to different types in one) staticaly one with vertexBuf of type daeTArray<float> and another with daeTArray<int> then using switch/if? or can I change it dynamically in run time somehow having just one pointer ?
I’m using COLLADA DOM 2.1 (c++) (1.4.1 schema)