From b59f2f8e555d1f8822235444150228adc198870a Mon Sep 17 00:00:00 2001 From: oakes Date: Thu, 22 May 2014 02:09:30 -0400 Subject: [PATCH] Allow model position to be set without assoc --- src/play_clj/entities.clj | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/play_clj/entities.clj b/src/play_clj/entities.clj index d281411..66d5a45 100644 --- a/src/play_clj/entities.clj +++ b/src/play_clj/entities.clj @@ -77,11 +77,12 @@ (draw-entity! [{:keys [^ModelInstance object x y z]} {:keys [^ModelBatch renderer ^Environment attributes]} _] - (let [^Matrix4 m (. object transform) - x (float (or x 0)) - y (float (or y 0)) - z (float (or z 0))] - (.setTranslation m x y z)) + (when (or x y z) + (let [^Matrix4 m (. object transform) + x (float (or x 0)) + y (float (or y 0)) + z (float (or z 0))] + (.setTranslation m x y z))) (.render renderer object attributes))) (defrecord ShapeEntity [object] Entity