From 954391ae3e832090f1ac4643482f759d08ad4473 Mon Sep 17 00:00:00 2001 From: Atlante45 Date: Wed, 11 Nov 2015 18:33:26 -0800 Subject: [PATCH] Fix models resizing When models are MUCH bigger one one axis than the others and we modify the scale only of one of those small axis, it wouldn't propagate because the change was relatively too small conpared to the size of the model --- libraries/render-utils/src/Model.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/libraries/render-utils/src/Model.cpp b/libraries/render-utils/src/Model.cpp index 5b9bfdca3d..e201893209 100644 --- a/libraries/render-utils/src/Model.cpp +++ b/libraries/render-utils/src/Model.cpp @@ -89,11 +89,7 @@ void Model::setScale(const glm::vec3& scale) { } void Model::setScaleInternal(const glm::vec3& scale) { - float scaleLength = glm::length(_scale); - float relativeDeltaScale = glm::length(_scale - scale) / scaleLength; - - const float ONE_PERCENT = 0.01f; - if (relativeDeltaScale > ONE_PERCENT || scaleLength < EPSILON) { + if (glm::distance(_scale, scale) > METERS_PER_MILLIMETER) { _scale = scale; initJointTransforms(); }