Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

<float_array>'s "digits" attribute is ignored both in Loader and Writer #652

Open
Stanislav96 opened this issue Jun 18, 2021 · 0 comments
Open

Comments

@Stanislav96
Copy link

Stanislav96 commented Jun 18, 2021

  1. In COLLADAStreamWriter <float_array>'s "digits" attribute is not written even if StreamWriter::mDoublePrecision is true. According to the specification "digits" should be set to 16-17 significant decimal digits for double instead of default value of 6 digits. I guess Source class in COLLADASWSource.h should write this attribute in prepareToAppendValues() depending on Type: 7-8 digits for float, 16-17 for double. const String CSWC::CSW_ATTRIBUTE_DIGITS = "digits"; should be also added to COLLADASWConstants.
  2. In COLLADASaxFrameworkLoader <float_array>'s "digits" attribute is ignored. Namely, SourceArrayLoader::begin__float_array ignores float_array__AttributeData::digits field. It always calls beginArray<FloatSource>, while it, probably, should call beginArray<DoubleSource> if digits is big enough (more than 7-8). Ideally, Source class should also store digits value to truncate exact value by the number of digits (e.g., in data__float_array). In any case, data__float_array should accept const double* data parameter and be able to determine mCurrentSoure type (btw, there is a typo in its name). Moreover, ColladaParserAutoGen14Private::_data__float_array as well as ColladaParserAutoGen15Private::_data__float_array should use characterData2DoubleData instead of characterData2FloatData so that <float_array>'s string values can be read as double values. Unfortunately, ColladaParserAutoGen14Private::_data__float_array doesn't know "digits" value so it probably can't determine whether to use float-s or double-s in each case.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant