diff --git a/src/MeshImporterExporter.cpp b/src/MeshImporterExporter.cpp index a69841cd..fab37165 100755 --- a/src/MeshImporterExporter.cpp +++ b/src/MeshImporterExporter.cpp @@ -2104,13 +2104,13 @@ void MeshImporterExporter::importer(const QStringList &_uriList, unsigned int ad // bounding-box extents <0.01 — the entity loads but sits // entirely inside the default near-clip distance and never // renders. Scale the parent SceneNode so the largest - // dimension lands at ~1 unit. Threshold of 0.01 avoids + // dimension lands at ~3 units. Threshold of 0.01 avoids // touching sensible-scale assets (anything from a few cm up). if (en && en->getMesh()) { const auto& bbSize = en->getBoundingBox().getSize(); const Ogre::Real maxExtent = std::max({bbSize.x, bbSize.y, bbSize.z}); if (maxExtent > 0.0f && maxExtent < 0.01f) { - const Ogre::Real factor = 1.0f / maxExtent; + const Ogre::Real factor = 3.0f / maxExtent; sn->setScale(factor, factor, factor); Ogre::LogManager::getSingleton().logMessage( "MeshImporterExporter: auto-scaled '" + en->getName() + diff --git a/src/MeshImporterExporter_test.cpp b/src/MeshImporterExporter_test.cpp index dd9fa1fb..694594d6 100644 --- a/src/MeshImporterExporter_test.cpp +++ b/src/MeshImporterExporter_test.cpp @@ -1695,7 +1695,7 @@ TEST(MeshImporterExporterStandaloneTest, FormatFileURI_ShortAliasUppercaseIsAppe // can come in with bounding-box extents below the camera near-clip // distance — they load but render invisible. The importer should detect // this and scale the parent SceneNode so the largest dimension lands -// at ~1 unit. +// at ~3 units. TEST_F(MeshImporterExporterTest, Importer_SubUnitMesh_AutoScalesParentNode) { ASSERT_TRUE(canLoadMeshFiles()) << "GL/hardware buffers required (Xvfb in CI)"; @@ -1730,8 +1730,8 @@ TEST_F(MeshImporterExporterTest, Importer_SubUnitMesh_AutoScalesParentNode) { auto* importedNode = manager->getSceneNodes().last(); const Ogre::Vector3 scale = importedNode->getScale(); - // Auto-scale should bring the largest dim to ~1. With a 0.005-unit - // extent the factor is ~200, but we test loosely (>= 50) to stay + // Auto-scale should bring the largest dim to ~3. With a 0.005-unit + // extent the factor is ~600, but we test loosely (>= 50) to stay // robust against future tweaks to the threshold. EXPECT_GE(scale.x, 50.0f) << "Sub-unit mesh did not get auto-scaled (x)"; EXPECT_GE(scale.y, 50.0f) << "Sub-unit mesh did not get auto-scaled (y)";