From 63c8a79023b7aab7cb7e241bd51b49f04442d4dc Mon Sep 17 00:00:00 2001 From: Hirek Date: Tue, 28 Jan 2025 00:43:57 +0100 Subject: [PATCH] Floating point export fix for models --- AnimModel.cpp | 6 +++--- scenenode.h | 5 ++--- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/AnimModel.cpp b/AnimModel.cpp index 557d85e0..787dfe56 100644 --- a/AnimModel.cpp +++ b/AnimModel.cpp @@ -656,9 +656,9 @@ TAnimModel::export_as_text_( std::ostream &Output ) const { // header Output << "model "; // location and rotation - Output - << location().x << ' ' - << location().y << ' ' + Output << std::fixed << std::setprecision(3) // ustawienie dokładnie 3 cyfr po przecinku + << location().x << ' ' + << location().y << ' ' << location().z << ' '; Output << "0 " ; diff --git a/scenenode.h b/scenenode.h index 760eab32..a63bd2a0 100644 --- a/scenenode.h +++ b/scenenode.h @@ -47,8 +47,7 @@ operator!=( lighting_data const &Left, lighting_data const &Right ) { namespace scene { struct bounding_area { - - glm::dvec3 center; // mid point of the rectangle + glm::highp_dvec3 center; // mid point of the rectangle float radius { -1.0f }; // radius of the bounding sphere bounding_area() = default; @@ -94,7 +93,7 @@ public: material_handle material { null_handle }; lighting_data lighting; // geometry data - glm::dvec3 origin; // world position of the relative coordinate system origin + glm::highp_dvec3 origin; // world position of the relative coordinate system origin gfx::geometry_handle geometry { 0, 0 }; // relative origin-centered chunk of geometry held by gfx renderer std::vector vertices; // world space source data of the geometry gfx::userdata_array userdata;