Sign in to follow this  

ColladaDOM getOffset Trouble

This topic is 2646 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi!

This is my first project with collada-dom and stepped on following problem:

I'm currently working on a cpp, 3D engine and want to load Collada dae files with the collada-dom library.
Everything seems to work fine when i parse these files but i got a little problem when getting to the domInput_local_offsetRef. To be specific with it's getOffset().

The important part in the collada file:

Quote:

..
<triangles count="10" material="Material">
<input semantic="VERTEX" source="#geometries_0-Vtx" offset="0"/>
<input semantic="NORMAL" source="#geometries_0-XSINormal" offset="1"/>
<input semantic="TEXCOORD" source="#geometries_0-Texture_Projection" offset="2"/>


..



the parsing code that works
Quote:

..
domP *p = triangle->getP();
//Get the sources
domInput_local_offset_Array inputs = triangle->getInput_array();

for(size_t r = 0;r != triangle->getCount()*3;r++) {

//Load the data from sources
for(int u = 0; u!=inputs.getCount(); u++) {
domInput_local_offsetRef input = inputs[u];
std::string offset = input->getAttribute("offset");
..

The value of offset in the debuger is correct ( "0","1","2" );

but when i use the dom objects to get the correct type
Quote:

..
domP *p = triangle->getP();
//Get the sources
domInput_local_offset_Array inputs = triangle->getInput_array();

for(size_t r = 0;r != triangle->getCount()*3;r++) {
//Load the data from sources

for(int u = 0; u!=inputs.getCount(); u++) {
domInput_local_offsetRef input = inputs[u];
domUint offset = input->getOffset();
..


The output of offset is definitly wrong ( 14829735428365912956, 14829735428365912956, 14829735428365912956)
Exact the same thing with inputs->getSemantic() the dae method works the dom just returns 0.

I don't understand where this is coming from but maybe someone got a hint for me :)
I don't want to convert these strings manualy

regards
Weinma

Share this post


Link to post
Share on other sites
Sign in to follow this