Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions scene/3d/node_3d.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,6 @@ void Node3D::set_basis(const Basis &p_basis) {
}
void Node3D::set_quaternion(const Quaternion &p_quaternion) {
ERR_THREAD_GUARD;
fti_notify_node_changed();

if (_test_dirty_bits(DIRTY_EULER_ROTATION_AND_SCALE)) {
// We need the scale part, so if these are dirty, update it
data.scale = data.local_transform.basis.get_scale();
Expand All @@ -308,6 +306,7 @@ void Node3D::set_quaternion(const Quaternion &p_quaternion) {
if (data.notify_local_transform) {
notification(NOTIFICATION_LOCAL_TRANSFORM_CHANGED);
}
fti_notify_node_changed();
}

Vector3 Node3D::get_global_position() const {
Expand Down Expand Up @@ -370,14 +369,14 @@ void Node3D::fti_notify_node_changed(bool p_transform_changed) {

void Node3D::set_transform(const Transform3D &p_transform) {
ERR_THREAD_GUARD;
fti_notify_node_changed();
data.local_transform = p_transform;
_replace_dirty_mask(DIRTY_EULER_ROTATION_AND_SCALE); // Make rot/scale dirty.

_propagate_transform_changed(this);
if (data.notify_local_transform) {
notification(NOTIFICATION_LOCAL_TRANSFORM_CHANGED);
}
fti_notify_node_changed();
}

Basis Node3D::get_basis() const {
Expand Down Expand Up @@ -600,12 +599,12 @@ Transform3D Node3D::get_relative_transform(const Node *p_parent) const {

void Node3D::set_position(const Vector3 &p_position) {
ERR_THREAD_GUARD;
fti_notify_node_changed();
data.local_transform.origin = p_position;
_propagate_transform_changed(this);
if (data.notify_local_transform) {
notification(NOTIFICATION_LOCAL_TRANSFORM_CHANGED);
}
fti_notify_node_changed();
}

void Node3D::set_rotation_edit_mode(RotationEditMode p_mode) {
Expand Down Expand Up @@ -682,7 +681,6 @@ EulerOrder Node3D::get_rotation_order() const {

void Node3D::set_rotation(const Vector3 &p_euler_rad) {
ERR_THREAD_GUARD;
fti_notify_node_changed();
if (_test_dirty_bits(DIRTY_EULER_ROTATION_AND_SCALE)) {
// Update scale only if rotation and scale are dirty, as rotation will be overridden.
data.scale = data.local_transform.basis.get_scale();
Expand All @@ -695,6 +693,7 @@ void Node3D::set_rotation(const Vector3 &p_euler_rad) {
if (data.notify_local_transform) {
notification(NOTIFICATION_LOCAL_TRANSFORM_CHANGED);
}
fti_notify_node_changed();
}

void Node3D::set_rotation_degrees(const Vector3 &p_euler_degrees) {
Expand All @@ -705,7 +704,6 @@ void Node3D::set_rotation_degrees(const Vector3 &p_euler_degrees) {

void Node3D::set_scale(const Vector3 &p_scale) {
ERR_THREAD_GUARD;
fti_notify_node_changed();
if (_test_dirty_bits(DIRTY_EULER_ROTATION_AND_SCALE)) {
// Update rotation only if rotation and scale are dirty, as scale will be overridden.
data.euler_rotation = data.local_transform.basis.get_euler_normalized(data.euler_rotation_order);
Expand All @@ -718,6 +716,7 @@ void Node3D::set_scale(const Vector3 &p_scale) {
if (data.notify_local_transform) {
notification(NOTIFICATION_LOCAL_TRANSFORM_CHANGED);
}
fti_notify_node_changed();
}

Vector3 Node3D::get_position() const {
Expand Down