From ca0e87b4d10345f820fc90bdf68beb8bc29651a8 Mon Sep 17 00:00:00 2001 From: surdeus Date: Sun, 21 Jan 2024 17:00:50 +0300 Subject: [PATCH] fix: fixed the 3-level parenting (the rotation problem) --- transform.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/transform.go b/transform.go index 8811f7e..790845d 100644 --- a/transform.go +++ b/transform.go @@ -140,6 +140,7 @@ func (t *Transform) Rotation() Float { func (t *Transform) Rotate(add Float) { t.dirty = true + t.parentDirty = true t.rotation += add } func (t *Transform) Around() Vector { @@ -201,7 +202,8 @@ func (t *Transform) MatrixForParenting() (Matrix, Matrix) { if t.parent != nil { pm, pmi := t.parent.MatrixForParenting() m.Concat(pm) - mi.Concat(pmi) + pmi.Concat(mi) + mi = pmi } return m, mi