Fix properties update in remote transform

This commit is contained in:
Aron Castro 2018-12-04 15:22:58 -02:00
parent 9a8569d434
commit 7619a8a30d

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);
}
}
}
}