Liking cljdoc? Tell your friends :D

jme-clj.core


*app*clj

source

*control*clj

source

action-listenerclj

(action-listener f)
source

add-anim-listenerclj

(add-anim-listener control listener)
source

add-controlclj

(add-control spatial control)
source

add-lightclj

(add-light spatial light)
source

add-light-to-rootclj

(add-light-to-root light)
source

add-to-rootclj

(add-to-root node)
source

analog-listenerclj

(analog-listener f)
source

anim-listenerclj

(anim-listener on-cycle-done on-anim-change)
source

app-settingsclj

(app-settings load-defaults?
              &
              {:keys [fullscreen? vsync? width height frequency title frame-rate
                      resizable?]})

Creates an AppSettings instance.

Creates an AppSettings instance.
sourceraw docstring

app-stateclj

(app-state kw & {:keys [init update on-enable on-disable cleanup]})

AppState represents continuously executing code inside the main loop.

e.g.: (app-state ::my-app-state :init (fn [] (println "App State initialized.")) :update (fn [tpf] (println "update:" tpf)) :on-enable (fn [] (println "on enable")) :on-disable (fn [] (println "on disable")) :cleanup (fn [] (println "cleaning")))

If any function returns a hash map, the hash map will be registered to the mutable global state under app-states entry.

Please have a look AppState and BaseAppState for more.

AppState represents continuously executing code inside the main loop.

e.g.:
(app-state ::my-app-state
           :init (fn [] (println "App State initialized."))
           :update (fn [tpf] (println "update:" tpf))
           :on-enable (fn [] (println "on enable"))
           :on-disable (fn [] (println "on disable"))
           :cleanup (fn [] (println "cleaning")))

If any function returns a hash map, the hash map will be registered to the mutable global state under
app-states entry.

Please have a look AppState and BaseAppState for more.
sourceraw docstring

apply-input-mappingclj

(apply-input-mapping {:keys [triggers listeners] :as m})
source

asset-managerclj

(asset-manager)
source

attachclj

(attach app-state)
source

attach-childclj

(attach-child node s)
source

audio-nodeclj

(audio-node name type)
source

bitmap-textclj

(bitmap-text gui-font right-to-left)
source

boxclj

(box x y z)
source

bullet-app-stateclj

(bullet-app-state)
source

call*cljmacro

(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))
sourceraw docstring

camclj

(cam)
source

capsule-collision-shapeclj

(capsule-collision-shape radius height axi)
source

character-controlclj

(character-control shape step-height)
source

clearclj

(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.
sourceraw docstring

collide-withclj

(collide-with o collidable results)
source

collision-resultsclj

(collision-results)
source

color-rgbaclj

(color-rgba r g b a)
source

contextclj

(context)
source

controlclj

(control kw & {:keys [update render]})

Controls are used to specify certain update and render logic for a Spatial.

If any function returns a hash map, the hash map will be registered to the mutable global state under controls entry.

(control ::my-control :update (fn [tpf] (println "update" tpf)) :render (fn [rm vp] (println "render" rm vp)))

Please have a look Control and AbstractControl for more.

Controls are used to specify certain update and render logic for a Spatial.

If any function returns a hash map, the hash map will be registered to the mutable global state under
controls entry.

(control ::my-control
         :update (fn [tpf] (println "update" tpf))
         :render (fn [rm vp] (println "render" rm vp)))

Please have a look Control and AbstractControl for more.
sourceraw docstring

control-enabled?clj

(control-enabled?)
source

create-channelclj

(create-channel control)
source

create-mesh-shapeclj

(create-mesh-shape spatial)
source

defsimpleappcljmacro

(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 mutable global 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 mutable global 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 mutable global 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 mutable global 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.
sourceraw docstring

detachclj

(detach app-state)
source

detach-all-childclj

(detach-all-child node)
source

emit-all-particlesclj

(emit-all-particles pe)
source

fly-camclj

(fly-cam)
source

generateclj

(generate mesh)
source

geoclj

(geo name mesh)
source

get*cljmacro

(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))
sourceraw docstring

get-hmclj

(get-hm hm)
source

get-main-stateclj

(get-main-state)

Returns the mutable global state map.

Returns the mutable global state map.
sourceraw docstring

get-spatialclj

(get-spatial)
source

get-stateclj

(get-state)
(get-state type)
source

gui-nodeclj

(gui-node)
source

imageclj

(image texture)
source

image-based-hmclj

(image-based-hm img)
source

input-managerclj

(input-manager)
source

instancesclj

A list of SimpleApplication instances created with defsimpleapp.

A list of SimpleApplication instances created with `defsimpleapp`.
sourceraw docstring

key-triggerclj

(key-trigger code)
source

letjcljmacro

(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}
sourceraw docstring

lightclj

(light type)
source

listenerclj

(listener)
source

load-assetclj

(load-asset path)
source

load-fontclj

(load-font path)
source

load-hmclj

(load-hm hm)
source

load-modelclj

(load-model path)
source

load-textureclj

(load-texture path)
source

look-atclj

(look-at pos world-up-vec)
(look-at cam pos world-up-vec)
source

map->app-settingsclj

(map->app-settings settings)
source

materialclj

(material path)
source

Matrixcljprotocol

addclj

(add this v)
(add this x y)
(add this x y z)

add-locclj

(add-loc this v)
(add-loc this x y z)

multclj

(mult this scalar)

mult-locclj

(mult-loc this scalar)

negateclj

(negate this)

setvclj

(setv this v)
(setv this x y)
(setv this x y z)
source

mouse-ax-triggerclj

(mouse-ax-trigger code negative?)
source

mouse-triggerclj

(mouse-trigger code)
source

nodeclj

(node name)
source

particle-emitterclj

(particle-emitter name type num-particles)
source

playclj

(play an)
source

play-insclj

(play-ins an)
source

raw-input-listenerclj

(raw-input-listener &
                    {:keys [begin-input end-input on-joy-axis-event
                            on-joy-button-event on-mouse-motion-event
                            on-mouse-button-event on-key-event on-touch-event]})
source

rayclj

(ray origin direction)
source

re-initclj

(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.
sourceraw docstring

register-locatorclj

(register-locator path locator)
source

remove-from-rootclj

(remove-from-root node)
source

remove-lightclj

(remove-light spatial light)
source

remove-stateclj

(remove-state ks)
(remove-state type ks)
source

rigid-body-controlclj

(rigid-body-control mass)
(rigid-body-control shape mass)
source

root-nodeclj

(root-node)
source

rotateclj

(rotate spatial x y z)
source

runcljmacro

(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.
sourceraw docstring

running?clj

(running? app)
source

scaleclj

(scale spatial s)
(scale spatial x y z)
source

scale-texture-coordsclj

(scale-texture-coords mesh scale-factor)
source

set*cljmacro

(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)
sourceraw docstring

set-display-fpsclj

(set-display-fps show)
source

set-display-stat-viewclj

(set-display-stat-view show)
source

set-stateclj

(set-state ks v)
(set-state type ks v)
source

setccljmacro

(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])
sourceraw docstring

sizeclj

(size o)
source

sphereclj

(sphere x y z)
(sphere x y z use-even-slices? interior?)
source

startclj

(start app)

Starts the SimpleApplication instance.

It's not recommended to call start fn after calling stop fn. 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.
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.
sourceraw docstring

state-managerclj

(state-manager)
source

statesclj

The mutable global state of the application. It keeps app, app-state, control states and others.

The mutable global state of the application.
It keeps app, app-state, control states and others.
sourceraw docstring

stopclj

(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. 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.
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.
sourceraw docstring

terrain-lod-controlclj

(terrain-lod-control terrain camera)
source

terrain-quadclj

(terrain-quad name path-size total-size hm)
source

unbind-allclj

(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`.
sourceraw docstring

unbind-appclj

(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`.
sourceraw docstring

unshaded-matclj

(unshaded-mat)
source

update-stateclj

(update-state type ks f & args)
source

vec2clj

(vec2)
(vec2 x y)
(vec2 x y normalize)
source

vec3clj

(vec3)
(vec3 x y z)
(vec3 x y z normalize)
source

view-portclj

(view-port)
source

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close