Upgrading PLY exporter to allow element definition as double

This commit is contained in:
Chris Russ
2016-07-16 18:22:01 +10:00
parent ad8bb32561
commit a7894b090d
2 changed files with 44 additions and 29 deletions

View File

@@ -819,15 +819,18 @@ bool PLY::PropertyInstance::ParseValue(
break;
case EDT_Float:
pCur = fast_atoreal_move<float>(pCur,out->fFloat);
// technically this should cast to float, but people tend to use float descriptors for double data
// this is the best way to not risk loosing precision on import and it doesn't hurt to do this
ai_real f;
pCur = fast_atoreal_move<ai_real>(pCur,f);
out->fFloat = (ai_real)f;
break;
case EDT_Double:
double f;
pCur = fast_atoreal_move<double>(pCur,f);
out->fDouble = (double)f;
double d;
pCur = fast_atoreal_move<double>(pCur,d);
out->fDouble = (double)d;
break;
default: