From 6666c854c6f340bee22f2dae3e2d63f647220555 Mon Sep 17 00:00:00 2001 From: oakes Date: Wed, 12 Feb 2014 21:31:48 -0500 Subject: [PATCH] Add animation-controller --- src/play_clj/g3d.clj | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/play_clj/g3d.clj b/src/play_clj/g3d.clj index bcc8ae0..e5c3dd5 100644 --- a/src/play_clj/g3d.clj +++ b/src/play_clj/g3d.clj @@ -6,7 +6,29 @@ ColorAttribute CubemapAttribute DepthTestAttribute FloatAttribute IntAttribute TextureAttribute] [com.badlogic.gdx.graphics.g3d.model.data ModelData] - [com.badlogic.gdx.graphics.g3d.utils ModelBuilder])) + [com.badlogic.gdx.graphics.g3d.utils AnimationController + ModelBuilder])) + +; animation-controller + +(defn animation-controller* + "The function version of `animation-controller`" + [entity] + (AnimationController. (u/get-obj entity :object))) + +(defmacro animation-controller + "Returns an [AnimationController](http://libgdx.badlogicgames.com/nightlies/docs/api/com/badlogic/gdx/graphics/g3d/utils/AnimationController.html) + + (animation-controller entity)" + [entity & options] + `(let [^AnimationController object# (animation-controller* ~entity)] + (u/calls! object# ~@options))) + +(defmacro animation-controller! + "Calls a single method on an `animation-controller`" + [object k & options] + `(let [^AnimationController object# ~object] + (u/call! object# ~k ~@options))) ; environment