From 8dc04dedbba31030b83b1a23c48c6bea02eea100 Mon Sep 17 00:00:00 2001 From: Dan Goodliffe Date: Sat, 27 Jan 2024 22:33:20 +0000 Subject: 3D relative scaling in asset factory Reduces excess vertices in cylinders --- assetFactory/cylinder.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'assetFactory/cylinder.cpp') diff --git a/assetFactory/cylinder.cpp b/assetFactory/cylinder.cpp index 29c09b0..fd96c8b 100644 --- a/assetFactory/cylinder.cpp +++ b/assetFactory/cylinder.cpp @@ -3,9 +3,9 @@ #include "modelFactoryMesh.h" Cylinder::CreatedFaces -Cylinder::createMesh(ModelFactoryMesh & mesh, float lodf) const +Cylinder::createMesh(ModelFactoryMesh & mesh, Scale3D lodf) const { - const auto P = static_cast(std::round(15.F * std::sqrt(lodf))); + const auto P = std::max(5U, static_cast(std::round(10.F * std::max(lodf.x, lodf.y)))); const auto step = two_pi / static_cast(P); // Generate 2D circumference points -- cgit v1.2.3