fix: fixed the 3-level parenting (the rotation problem)

This commit is contained in:
Andrey Parhomenko 2024-01-21 17:00:50 +03:00
parent 9203bd1e79
commit ca0e87b4d1

View file

@ -140,6 +140,7 @@ func (t *Transform) Rotation() Float {
func (t *Transform) Rotate(add Float) { func (t *Transform) Rotate(add Float) {
t.dirty = true t.dirty = true
t.parentDirty = true
t.rotation += add t.rotation += add
} }
func (t *Transform) Around() Vector { func (t *Transform) Around() Vector {
@ -201,7 +202,8 @@ func (t *Transform) MatrixForParenting() (Matrix, Matrix) {
if t.parent != nil { if t.parent != nil {
pm, pmi := t.parent.MatrixForParenting() pm, pmi := t.parent.MatrixForParenting()
m.Concat(pm) m.Concat(pm)
mi.Concat(pmi) pmi.Concat(mi)
mi = pmi
} }
return m, mi return m, mi