mirror of
https://github.com/lubosz/overte.git
synced 2025-04-10 15:57:39 +02:00
Merge pull request #8224 from sethalves/refresh-feature/grab-script-polish
Refresh feature/grab script polish
This commit is contained in:
commit
e0739dcc9c
2 changed files with 260 additions and 264 deletions
|
@ -43,7 +43,6 @@ ModelOverlay::ModelOverlay(const ModelOverlay* modelOverlay) :
|
|||
void ModelOverlay::update(float deltatime) {
|
||||
if (_updateModel) {
|
||||
_updateModel = false;
|
||||
|
||||
_model->setSnapModelToCenter(true);
|
||||
_model->setScaleToFit(true, getDimensions());
|
||||
_model->setRotation(getRotation());
|
||||
|
@ -87,23 +86,15 @@ void ModelOverlay::render(RenderArgs* args) {
|
|||
void ModelOverlay::setProperties(const QVariantMap& properties) {
|
||||
auto position = getPosition();
|
||||
auto rotation = getRotation();
|
||||
auto scale = getDimensions();
|
||||
|
||||
|
||||
Volume3DOverlay::setProperties(properties);
|
||||
|
||||
|
||||
if (position != getPosition() || rotation != getRotation()) {
|
||||
_updateModel = true;
|
||||
}
|
||||
|
||||
if (scale != getDimensions()) {
|
||||
auto newScale = getDimensions();
|
||||
if (newScale.x <= 0 || newScale.y <= 0 || newScale.z <= 0) {
|
||||
setDimensions(scale);
|
||||
} else {
|
||||
_updateModel = true;
|
||||
}
|
||||
}
|
||||
|
||||
_updateModel = true;
|
||||
|
||||
auto urlValue = properties["url"];
|
||||
if (urlValue.isValid() && urlValue.canConvert<QString>()) {
|
||||
_url = urlValue.toString();
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue