mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 00:44:12 +02:00
Merge pull request #7365 from howard-stearns/reregister-and-scale-after-model-change
Reregister and scale after model change
This commit is contained in:
commit
d840e68f05
1 changed files with 7 additions and 0 deletions
|
@ -48,6 +48,13 @@ RenderableModelEntityItem::~RenderableModelEntityItem() {
|
|||
|
||||
void RenderableModelEntityItem::setModelURL(const QString& url) {
|
||||
auto& currentURL = getParsedModelURL();
|
||||
if (_model && (currentURL != url)) {
|
||||
// The machinery for updateModelBounds will give existing models the opportunity to fix their translation/rotation/scale/registration.
|
||||
// The first two are straightforward, but the latter two have guards to make sure they don't happen after they've already been set.
|
||||
// Here we reset those guards. This doesn't cause the entity values to change -- it just allows the model to match once it comes in.
|
||||
_model->setScaleToFit(false, getDimensions());
|
||||
_model->setSnapModelToRegistrationPoint(false, getRegistrationPoint());
|
||||
}
|
||||
ModelEntityItem::setModelURL(url);
|
||||
|
||||
if (currentURL != getParsedModelURL() || !_model) {
|
||||
|
|
Loading…
Reference in a new issue