mirror of
https://thingvellir.net/git/overte
synced 2025-03-27 23:52:03 +01:00
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
This commit is contained in:
parent
820517f340
commit
954391ae3e
1 changed files with 1 additions and 5 deletions
|
@ -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();
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue