[WIP] Use ai_Real to write correct accuracy
- closes https://github.com/assimp/assimp/issues/4676pull/4697/head
parent
94c3ec57af
commit
2013ae114a
|
@ -130,7 +130,7 @@ inline size_t Write<double>(IOStream *stream, const double &f) {
|
||||||
// Serialize a vec3
|
// Serialize a vec3
|
||||||
template <>
|
template <>
|
||||||
inline size_t Write<aiVector3D>(IOStream *stream, const aiVector3D &v) {
|
inline size_t Write<aiVector3D>(IOStream *stream, const aiVector3D &v) {
|
||||||
size_t t = Write<float>(stream, v.x);
|
size_t t = Write<ai_real>(stream, v.x);
|
||||||
t += Write<float>(stream, v.y);
|
t += Write<float>(stream, v.y);
|
||||||
t += Write<float>(stream, v.z);
|
t += Write<float>(stream, v.z);
|
||||||
|
|
||||||
|
@ -141,7 +141,7 @@ inline size_t Write<aiVector3D>(IOStream *stream, const aiVector3D &v) {
|
||||||
// Serialize a color value
|
// Serialize a color value
|
||||||
template <>
|
template <>
|
||||||
inline size_t Write<aiColor3D>(IOStream *stream, const aiColor3D &v) {
|
inline size_t Write<aiColor3D>(IOStream *stream, const aiColor3D &v) {
|
||||||
size_t t = Write<float>(stream, v.r);
|
size_t t = Write<ai_real>(stream, v.r);
|
||||||
t += Write<float>(stream, v.g);
|
t += Write<float>(stream, v.g);
|
||||||
t += Write<float>(stream, v.b);
|
t += Write<float>(stream, v.b);
|
||||||
|
|
||||||
|
@ -152,7 +152,7 @@ inline size_t Write<aiColor3D>(IOStream *stream, const aiColor3D &v) {
|
||||||
// Serialize a color value
|
// Serialize a color value
|
||||||
template <>
|
template <>
|
||||||
inline size_t Write<aiColor4D>(IOStream *stream, const aiColor4D &v) {
|
inline size_t Write<aiColor4D>(IOStream *stream, const aiColor4D &v) {
|
||||||
size_t t = Write<float>(stream, v.r);
|
size_t t = Write<ai_real>(stream, v.r);
|
||||||
t += Write<float>(stream, v.g);
|
t += Write<float>(stream, v.g);
|
||||||
t += Write<float>(stream, v.b);
|
t += Write<float>(stream, v.b);
|
||||||
t += Write<float>(stream, v.a);
|
t += Write<float>(stream, v.a);
|
||||||
|
@ -164,7 +164,7 @@ inline size_t Write<aiColor4D>(IOStream *stream, const aiColor4D &v) {
|
||||||
// Serialize a quaternion
|
// Serialize a quaternion
|
||||||
template <>
|
template <>
|
||||||
inline size_t Write<aiQuaternion>(IOStream *stream, const aiQuaternion &v) {
|
inline size_t Write<aiQuaternion>(IOStream *stream, const aiQuaternion &v) {
|
||||||
size_t t = Write<float>(stream, v.w);
|
size_t t = Write<ai_real>(stream, v.w);
|
||||||
t += Write<float>(stream, v.x);
|
t += Write<float>(stream, v.x);
|
||||||
t += Write<float>(stream, v.y);
|
t += Write<float>(stream, v.y);
|
||||||
t += Write<float>(stream, v.z);
|
t += Write<float>(stream, v.z);
|
||||||
|
@ -190,7 +190,7 @@ template <>
|
||||||
inline size_t Write<aiMatrix4x4>(IOStream *stream, const aiMatrix4x4 &m) {
|
inline size_t Write<aiMatrix4x4>(IOStream *stream, const aiMatrix4x4 &m) {
|
||||||
for (unsigned int i = 0; i < 4; ++i) {
|
for (unsigned int i = 0; i < 4; ++i) {
|
||||||
for (unsigned int i2 = 0; i2 < 4; ++i2) {
|
for (unsigned int i2 = 0; i2 < 4; ++i2) {
|
||||||
Write<float>(stream, m[i][i2]);
|
Write<ai_real>(stream, m[i][i2]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue