From ac990359cb9f060da1f0c5179972455910500ce6 Mon Sep 17 00:00:00 2001 From: ~keith Date: Tue, 4 Jan 2022 20:48:31 +0000 Subject: [PATCH] reveal inconsistency in child transformations --- wh-engine/actor.lisp | 1 - wh-engine/component.lisp | 1 - wh-engine/main.lisp | 16 ++++++++++++++-- wh-engine/scene.lisp | 1 - 4 files changed, 14 insertions(+), 5 deletions(-) diff --git a/wh-engine/actor.lisp b/wh-engine/actor.lisp index 265098b..bdf2a20 100644 --- a/wh-engine/actor.lisp +++ b/wh-engine/actor.lisp @@ -73,7 +73,6 @@ (:documentation "Base class for entities in the game.")) (defmethod make-load-form ((this actor) &optional environment) - ;(make-load-form-saving-slots this :environment environment) (make-generic-load-form this :environment environment)) (defmethod scene ((this actor)) diff --git a/wh-engine/component.lisp b/wh-engine/component.lisp index 5d9a6f7..9ed9974 100644 --- a/wh-engine/component.lisp +++ b/wh-engine/component.lisp @@ -18,7 +18,6 @@ (:documentation "Base class for components attached to game entities.")) (defmethod make-load-form ((this component) &optional environment) - ;(make-load-form-saving-slots this :environment environment) (make-generic-load-form this :environment environment)) (defmethod actor ((this component)) diff --git a/wh-engine/main.lisp b/wh-engine/main.lisp index 101b010..7d89cbb 100644 --- a/wh-engine/main.lisp +++ b/wh-engine/main.lisp @@ -119,7 +119,7 @@ "List of all known views.") (defun register-test-scene () - (let (test-scene test-actor test-drawable test-actor-2 camera-actor camera-view child-actor) + (let (test-scene test-actor test-drawable test-actor-2 camera-actor camera-view child-actor grandchild-actor) (setf test-scene (make-instance 'scene :id -1 :name "Test scene")) @@ -145,7 +145,7 @@ (setf child-actor (make-instance 'actor :name "Child Actor" - :location (vec2 0.0 0.5) + :location (vec2 0 0.5) :z-layer -2)) [test-scene (add-actor child-actor)] [test-actor-2 (add-child child-actor)] @@ -154,6 +154,18 @@ :colour (vec4 0.0 1.0 1.0 1.0))) ] + (setf grandchild-actor (make-instance 'actor + :name "Grandchild Actor" + :location (vec2 0 1) + :scale (vec2 0.25 0.25) + :z-layer 1)) + [test-scene (add-actor grandchild-actor)] + [child-actor (add-child grandchild-actor)] + + [grandchild-actor (add-component (make-instance 'drawable-test + :colour (vec4 1.0 1.0 0.0 0.0))) + ] + (setf camera-actor (make-instance 'actor :name "Camera")) [test-scene (add-actor camera-actor)] diff --git a/wh-engine/scene.lisp b/wh-engine/scene.lisp index b30075c..a2f0f0d 100644 --- a/wh-engine/scene.lisp +++ b/wh-engine/scene.lisp @@ -23,7 +23,6 @@ (:documentation "A scene containing game entities.")) (defmethod make-load-form ((this scene) &optional environment) - ;(make-load-form-saving-slots this :environment environment) (make-generic-load-form this :environment environment)) (defmethod print-object ((this scene) stream)