diff options
Diffstat (limited to 'extern/draco/dracoenc/src/draco/attributes/attribute_quantization_transform.cc')
-rw-r--r-- | extern/draco/dracoenc/src/draco/attributes/attribute_quantization_transform.cc | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/extern/draco/dracoenc/src/draco/attributes/attribute_quantization_transform.cc b/extern/draco/dracoenc/src/draco/attributes/attribute_quantization_transform.cc index 41193f1452f..237becefc61 100644 --- a/extern/draco/dracoenc/src/draco/attributes/attribute_quantization_transform.cc +++ b/extern/draco/dracoenc/src/draco/attributes/attribute_quantization_transform.cc @@ -92,6 +92,11 @@ bool AttributeQuantizationTransform::ComputeParameters( range_ = dif; } + // In case all values are the same, initialize the range to unit length. This + // will ensure that all values are quantized properly to the same value. + if (range_ == 0.f) + range_ = 1.f; + return true; } |