Adding double precision import support for formats that can be exported

This commit is contained in:
Chris Russ
2016-07-16 12:14:36 +10:00
parent fa1d6d8c55
commit 05a6ee6473
26 changed files with 204 additions and 233 deletions

View File

@@ -162,12 +162,12 @@ void STLExporter :: WriteMeshBinary(const aiMesh* m)
}
nor.Normalize();
}
float nx = nor.x, ny = nor.y, nz = nor.z;
ai_real nx = nor.x, ny = nor.y, nz = nor.z;
AI_SWAP4(nx); AI_SWAP4(ny); AI_SWAP4(nz);
mOutput.write((char *)&nx, 4); mOutput.write((char *)&ny, 4); mOutput.write((char *)&nz, 4);
for(unsigned int a = 0; a < f.mNumIndices; ++a) {
const aiVector3D& v = m->mVertices[f.mIndices[a]];
float vx = v.x, vy = v.y, vz = v.z;
ai_real vx = v.x, vy = v.y, vz = v.z;
AI_SWAP4(vx); AI_SWAP4(vy); AI_SWAP4(vz);
mOutput.write((char *)&vx, 4); mOutput.write((char *)&vy, 4); mOutput.write((char *)&vz, 4);
}