Locale independent meter scale
`XmlParser::getRealAttribute(...)` will call `strtod` (or `wcstod`) which are both locale dependent. So on a German locale system a scale of 0.01 meter will be parsed to 0. In order to avoid that I use the `fast_atoreal_move<ai_real>()` method.pull/4323/head
parent
1d815fc23e
commit
04d2d13172
|
@ -331,7 +331,16 @@ void ColladaParser::ReadAssetInfo(XmlNode &node) {
|
|||
const std::string ¤tName = currentNode.name();
|
||||
if (currentName == "unit") {
|
||||
mUnitSize = 1.f;
|
||||
XmlParser::getRealAttribute(currentNode, "meter", mUnitSize);
|
||||
std::string tUnitSizeString;
|
||||
if (XmlParser::getStdStrAttribute(currentNode, "meter", tUnitSizeString)) {
|
||||
try {
|
||||
fast_atoreal_move<ai_real>(tUnitSizeString.data(), mUnitSize);
|
||||
} catch (DeadlyImportError die) {
|
||||
std::string warning("Collada: Failed to parse meter parameter to real number. Exception:\n");
|
||||
warning.append(die.what());
|
||||
ASSIMP_LOG_WARN(warning.data());
|
||||
}
|
||||
}
|
||||
} else if (currentName == "up_axis") {
|
||||
std::string v;
|
||||
if (!XmlParser::getValueAsString(currentNode, v)) {
|
||||
|
|
Loading…
Reference in New Issue