mirror of
https://github.com/AleziaKurdis/overte.git
synced 2025-04-13 21:27:21 +02:00
Merge pull request #15324 from AndrewMeadows/avoid-nan-model-scale
Case 22054: flat models can introduce nan into geometry
This commit is contained in:
commit
bda54c71ea
2 changed files with 3 additions and 1 deletions
|
@ -1289,6 +1289,8 @@ void Model::scaleToFit() {
|
|||
// size is our "target size in world space"
|
||||
// we need to set our model scale so that the extents of the mesh, fit in a box that size...
|
||||
glm::vec3 meshDimensions = modelMeshExtents.maximum - modelMeshExtents.minimum;
|
||||
const glm::vec3 MIN_MESH_DIMENSIONS { 1.0e-6f }; // one micrometer
|
||||
meshDimensions = glm::max(meshDimensions, MIN_MESH_DIMENSIONS);
|
||||
glm::vec3 rescaleDimensions = _scaleToFitDimensions / meshDimensions;
|
||||
setScaleInternal(rescaleDimensions);
|
||||
_scaledToFit = true;
|
||||
|
|
|
@ -397,7 +397,7 @@ protected:
|
|||
|
||||
glm::vec3 _translation; // this is the translation in world coordinates to the model's registration point
|
||||
glm::quat _rotation;
|
||||
glm::vec3 _scale;
|
||||
glm::vec3 _scale { 1.0f };
|
||||
|
||||
glm::vec3 _overrideTranslation;
|
||||
glm::quat _overrideRotation;
|
||||
|
|
Loading…
Reference in a new issue