Skip to content

Instantly share code, notes, and snippets.

@ertugrulcetin
Created November 30, 2020 15:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ertugrulcetin/9899af261db0f91dddf00dacbebf0bab to your computer and use it in GitHub Desktop.
Save ertugrulcetin/9899af261db0f91dddf00dacbebf0bab to your computer and use it in GitHub Desktop.
(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