summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--catbird/node-2d.scm9
1 files changed, 5 insertions, 4 deletions
diff --git a/catbird/node-2d.scm b/catbird/node-2d.scm
index 47749cc..a7fcda8 100644
--- a/catbird/node-2d.scm
+++ b/catbird/node-2d.scm
@@ -152,11 +152,12 @@
(define (refresh-world-matrix node world)
(let ((p (parent node))
(local (local-matrix node)))
+ ;; If the parent isn't a 2D node, then we consider this to be a
+ ;; root node, which means the world matrix is the same as the
+ ;; local matrix.
(if (is-a? p <node-2d>)
- (matrix4-mult! world local (world-matrix (parent node)))
- (begin
- (matrix4-identity! world)
- (matrix4-mult! world world local)))
+ (matrix4-mult! world local (world-matrix p))
+ (matrix4-copy! local world))
world))
(define (refresh-inverse-world-matrix node inverse)