Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
(ns jm-clj.core
(:import (com.jme3.app SimpleApplication)
(com.jme3.scene.shape Box)
(com.jme3.scene Geometry)
(com.jme3.material Material)
(com.jme3.math ColorRGBA)))
;(def ^:dynamic *app-settings* (doto (AppSettings. true)
; (.setFullscreen false)
; (.setTitle "jme_clj")))
(defn my-logic [this]
(let [b (Box. 1 1 1)
geom (Geometry. "Box" b)
mat (Material. (.getAssetManager ^SimpleApplication this) "Common/MatDefs/Misc/Unshaded.j3md")]
(.setColor mat "Color" ColorRGBA/Green)
(.setMaterial geom mat)
(doto (.getRootNode this)
(.attachChild geom))))
(def app (proxy [SimpleApplication] []
(simpleInitApp []
(my-logic this))))
(defn -main [& args]
(doto app
(.setShowSettings false)
(.setPauseOnLostFocus false)
(.start)))
(comment
;; this fails
(.update app)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment