aboutsummaryrefslogtreecommitdiff
path: root/scene/3d/spatial.cpp
diff options
context:
space:
mode:
authorJuan Linietsky2017-01-10 22:22:56 -0300
committerGitHub2017-01-10 22:22:56 -0300
commit0acd4fccd566fdb074aebac01046b1e80c64b2dc (patch)
treedefce0bc5663677db80fa6adfe7214b2ee10eac4 /scene/3d/spatial.cpp
parent4338c9016347159d9562a5435e4c81afc21a362a (diff)
parent6b1252cdfa5988b77917518bc291a0cc34e5066e (diff)
downloadgodot-0acd4fccd566fdb074aebac01046b1e80c64b2dc.tar.gz
godot-0acd4fccd566fdb074aebac01046b1e80c64b2dc.tar.zst
godot-0acd4fccd566fdb074aebac01046b1e80c64b2dc.zip
Merge pull request #7438 from tagcup/matrix3_rotate_fix
Fix the order in which additional transformations are applied
Diffstat (limited to 'scene/3d/spatial.cpp')
-rw-r--r--scene/3d/spatial.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/scene/3d/spatial.cpp b/scene/3d/spatial.cpp
index b5e80c48a..50f9e4501 100644
--- a/scene/3d/spatial.cpp
+++ b/scene/3d/spatial.cpp
@@ -83,9 +83,9 @@ void Spatial::_notify_dirty() {
void Spatial::_update_local_transform() const {
-
- data.local_transform.basis.set_euler(data.rotation);
+ data.local_transform.basis = Matrix3();
data.local_transform.basis.scale(data.scale);
+ data.local_transform.basis.rotate(data.rotation);
data.dirty&=~DIRTY_LOCAL;
}
@@ -376,7 +376,7 @@ void Spatial::_set_rotation_deg(const Vector3& p_euler_deg) {
void Spatial::set_scale(const Vector3& p_scale){
if (data.dirty&DIRTY_VECTORS) {
- data.rotation=data.local_transform.basis.get_euler();
+ data.rotation=data.local_transform.basis.get_rotation();
data.dirty&=~DIRTY_VECTORS;
}
@@ -398,7 +398,8 @@ Vector3 Spatial::get_rotation() const{
if (data.dirty&DIRTY_VECTORS) {
data.scale=data.local_transform.basis.get_scale();
- data.rotation=data.local_transform.basis.get_euler();
+ data.rotation=data.local_transform.basis.get_rotation();
+
data.dirty&=~DIRTY_VECTORS;
}
@@ -422,7 +423,8 @@ Vector3 Spatial::get_scale() const{
if (data.dirty&DIRTY_VECTORS) {
data.scale=data.local_transform.basis.get_scale();
- data.rotation=data.local_transform.basis.get_euler();
+ data.rotation=data.local_transform.basis.get_rotation();
+
data.dirty&=~DIRTY_VECTORS;
}