Merge pull request #24161 from aroncds/master

Fix properties update in remote transform
This commit is contained in:
Rémi Verschelde 2018-12-14 13:34:46 +01:00 committed by GitHub
commit 31aaff3b21
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -63,38 +63,40 @@ void RemoteTransform::_update_remote() {
if (update_remote_position && update_remote_rotation && update_remote_scale) {
n->set_global_transform(get_global_transform());
} else {
Transform n_trans = n->get_global_transform();
Transform our_trans = get_global_transform();
if (!update_remote_position)
our_trans.set_origin(n_trans.get_origin());
if (update_remote_rotation)
n->set_rotation(our_trans.basis.get_rotation());
n->set_global_transform(our_trans);
if (update_remote_scale)
n->set_scale(our_trans.basis.get_scale());
if (!update_remote_rotation)
n->set_rotation(n_trans.basis.get_rotation());
if (update_remote_position) {
Transform n_trans = n->get_global_transform();
if (!update_remote_scale)
n->set_scale(n_trans.basis.get_scale());
n_trans.set_origin(our_trans.get_origin());
n->set_global_transform(n_trans);
}
}
} else {
if (update_remote_position && update_remote_rotation && update_remote_scale) {
n->set_global_transform(get_global_transform());
n->set_transform(get_transform());
} else {
Transform n_trans = n->get_transform();
Transform our_trans = get_transform();
if (!update_remote_position)
our_trans.set_origin(n_trans.get_origin());
if (update_remote_rotation)
n->set_rotation(our_trans.basis.get_rotation());
n->set_transform(our_trans);
if (update_remote_scale)
n->set_scale(our_trans.basis.get_scale());
if (!update_remote_rotation)
n->set_rotation(n_trans.basis.get_rotation());
if (update_remote_position) {
Transform n_trans = n->get_transform();
if (!update_remote_scale)
n->set_scale(n_trans.basis.get_scale());
n_trans.set_origin(our_trans.get_origin());
n->set_transform(n_trans);
}
}
}
}