(app-settings load-defaults?
&
{:keys [fullscreen? vsync? width height frequency title frame-rate
resizable?]})
Creates an AppSettings instance.
Creates an AppSettings instance.
(call* obj kw & args)
Java interop for methods. Since we can't wrap all functions of jMonkeyEngine, we can use a shortcut like this.
e.g.: (call* player :jump (vec3 0 20 0)) -> (.jump player (vec3 0 20 0))
Java interop for methods. Since we can't wrap all functions of jMonkeyEngine, we can use a shortcut like this. e.g.: (call* player :jump (vec3 0 20 0)) -> (.jump player (vec3 0 20 0))
(clear app)
Detaches all child nodes and removes all local lights from the root node.
Detaches all child nodes and removes all local lights from the root node.
(defsimpleapp name & {:keys [opts init update]})
Creates a SimpleApplication instance and binds with given name. Requires 3 parameters besides name. init (initialize fn, required) update (update fn, optional) opts (app settings, optional)
e.g.: (defsimpleapp app :opts {:show-settings? false :pause-on-lost-focus? false :settings {:title "My JME Game" :load-defaults? true :frame-rate 60}} :init init :update simple-update)
When init fn returns a hash map, this map registered to the global mutable state so it can be accessed from update fn and other fns. Also, this applies for the update fn, it's content merged to the global mutable state.
For other settings options, please have a look app-settings
fn.
It's not recommended to create multiple defsimpleapp instances inside one JVM. Some odd behaviours might occur due to shared states. Please run new JVM instance per application.
If you would like to run another SimpleApplication instance inside the same JVM (same REPL),
an option could be using unbind-app
for unbinding current app (var), and re-defining app with defsimpleapp
.
Please have a look at com.jme3.app.SimpleApplication for more.
Creates a SimpleApplication instance and binds with given name. Requires 3 parameters besides name. init (initialize fn, required) update (update fn, optional) opts (app settings, optional) e.g.: (defsimpleapp app :opts {:show-settings? false :pause-on-lost-focus? false :settings {:title "My JME Game" :load-defaults? true :frame-rate 60}} :init init :update simple-update) When init fn returns a hash map, this map registered to the global mutable state so it can be accessed from update fn and other fns. Also, this applies for the update fn, it's content merged to the global mutable state. For other settings options, please have a look `app-settings` fn. It's not recommended to create multiple defsimpleapp instances inside one JVM. Some odd behaviours might occur due to shared states. Please run new JVM instance per application. If you would like to run another SimpleApplication instance inside the same JVM (same REPL), an option could be using `unbind-app` for unbinding current app (var), and re-defining app with `defsimpleapp`. Please have a look at com.jme3.app.SimpleApplication for more.
(get* obj kw & args)
Java interop for methods with get
prefix.
e.g.: (get* (cam) :rotation) -> (.getRotation (cam))
Java interop for methods with `get` prefix. e.g.: (get* (cam) :rotation) -> (.getRotation (cam))
(get-main-state)
Returns the global mutable state map for the whole application.
Returns the global mutable state map for the whole application.
(get-state)
Returns value of :jme-clj.core/app key. It's used for keeping SimpleApplication's state.
Returns value of :jme-clj.core/app key. It's used for keeping SimpleApplication's state.
(letj bindings & body)
Executes the body and returns a hash map with key-val pairs that extracted from bindings. Ignores _
bindings.
e.g.: (letj [shootables (node "Shootables") _ (init-keys) _ (init-cross-hairs) mark (init-mark)] (-> shootables (add-to-root) (attach-child (make-cube "the Deputy" 1 0 -4)) (attach-child (make-floor)) (attach-child (make-char))))
=> {:mark mark :shootables shootables}
Executes the body and returns a hash map with key-val pairs that extracted from bindings. Ignores `_` bindings. e.g.: (letj [shootables (node "Shootables") _ (init-keys) _ (init-cross-hairs) mark (init-mark)] (-> shootables (add-to-root) (attach-child (make-cube "the Deputy" 1 0 -4)) (attach-child (make-floor)) (attach-child (make-char)))) => {:mark mark :shootables shootables}
(add this v)
(add this x y)
(add this x y z)
(add-loc this v)
(add-loc this x y z)
(mult this scalar)
(mult-loc this scalar)
(negate this)
(setv this v)
(setv this x y)
(setv this x y z)
(re-init init-fn)
Re-initializes the app with given init fn. It does not stop the app. Can be used when new code changes needed for the init fn.
Re-initializes the app with given init fn. It does not stop the app. Can be used when new code changes needed for the init fn.
(remove-state ks)
Removes a key inside :jme-clj.core/app entry. It's used for updating SimpleApplication's state.
Removes a key inside :jme-clj.core/app entry. It's used for updating SimpleApplication's state.
(run app & body)
Every code that changes the state should be wrapped with run
macro.
Otherwise Make sure you do not modify the scene from another thread!
exception will be thrown.
Every code that changes the state should be wrapped with `run` macro. Otherwise `Make sure you do not modify the scene from another thread!` exception will be thrown.
(set* obj kw & args)
Java interop for methods with set
prefix. Since it returns the given object,
this fn can be chained with other set*
s using the thread-first ->
macro.
e.g.: (set* channel :speed 1.0) -> (.setSpeed channel 1.0)
Java interop for methods with `set` prefix. Since it returns the given object, this fn can be chained with other `set*`s using the thread-first `->` macro. e.g.: (set* channel :speed 1.0) -> (.setSpeed channel 1.0)
(set-state ks v)
Sets a key-value pair inside :jme-clj.core/app entry. It's used for updating SimpleApplication's state.
Sets a key-value pair inside :jme-clj.core/app entry. It's used for updating SimpleApplication's state.
(setc obj & args)
Compact version of set*
e.g.:
(setc debris
:material mat-debris
:images-x 3
:images-y 3
:rotate-speed 4
:select-random-image true
:start-color ColorRGBA/White
:gravity [0 6 0]
:low-life 1
:high-life 3)
When you need to pass multiple parameters, use a vector. e.g.: (setc :local-translation [0.0 -5.0 -2.0])
Compact version of `set*` e.g.: (setc debris :material mat-debris :images-x 3 :images-y 3 :rotate-speed 4 :select-random-image true :start-color ColorRGBA/White :gravity [0 6 0] :low-life 1 :high-life 3) When you need to pass multiple parameters, use a vector. e.g.: (setc :local-translation [0.0 -5.0 -2.0])
(start app)
Starts the SimpleApplication instance.
It's not recommended to call start
fn after calling stop
fn. Should be used for development purposes only.
Some odd behaviours might occur such as JVM crash (based on the app, apps use Bullet API [not always]).
If you would like to re-start the app then use unbind-app
instead of stop
,
after re-defining app with defsimpleapp
then call start
again.
Starts the SimpleApplication instance. It's not recommended to call `start` fn after calling `stop` fn. Should be used for development purposes only. Some odd behaviours might occur such as JVM crash (based on the app, apps use Bullet API [not always]). If you would like to re-start the app then use `unbind-app` instead of `stop`, after re-defining app with `defsimpleapp` then call `start` again.
(stop app)
Stops the SimpleApplication instance. Can be used when the user wants to exit from the game.
It's not recommended to call start
fn after calling stop
fn. Should be used for development purposes only.
Some odd behaviours might occur such as JVM crash (based on the app, apps use Bullet API [not always]).
If you would like to re-start the app then use unbind-app
instead of stop
,
after re-defining app with defsimpleapp
then call start
again.
Stops the SimpleApplication instance. Can be used when the user wants to exit from the game. It's not recommended to call `start` fn after calling `stop` fn. Should be used for development purposes only. Some odd behaviours might occur such as JVM crash (based on the app, apps use Bullet API [not always]). If you would like to re-start the app then use `unbind-app` instead of `stop`, after re-defining app with `defsimpleapp` then call `start` again.
(unbind-all)
Unbinds all SimpleApplication instances from the vars. Should be used for development purposes only. Can be used for some leftover instances in the REPL.
e.g.: (unbind-all)
After calling unbind-all
, app
can be re-defined with defsimpleapp
.
Unbinds all SimpleApplication instances from the vars. Should be used for development purposes only. Can be used for some leftover instances in the REPL. e.g.: (unbind-all) After calling `unbind-all`, `app` can be re-defined with `defsimpleapp`.
(unbind-app v)
Unbinds the SimpleApplication instance from the var. Should be used for development purposes only.
e.g.: (unbind-app #'my-ns/app)
After calling unbind-app
, app
can be re-defined with defsimpleapp
.
Unbinds the SimpleApplication instance from the var. Should be used for development purposes only. e.g.: (unbind-app #'my-ns/app) After calling `unbind-app`, `app` can be re-defined with `defsimpleapp`.
(update-state ks f & args)
Updates :jme-clj.core/app entry. It's used for updating SimpleApplication's state.
Updates :jme-clj.core/app entry. It's used for updating SimpleApplication's state.
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close