comparison org/body.org @ 49:96a41b384100

working on animations in jMonkeyEngine3
author Robert McIntyre <rlm@mit.edu>
date Sat, 12 Nov 2011 16:52:38 -0700
parents ee55966ce7f6
children b1b90c4ab0bf
comparison
equal deleted inserted replaced
48:acd040680005 49:96a41b384100
25 (view 25 (view
26 (.loadModel 26 (.loadModel
27 (doto (asset-manager) 27 (doto (asset-manager)
28 (.registerLoader BlenderModelLoader (into-array String ["blend"]))) 28 (.registerLoader BlenderModelLoader (into-array String ["blend"])))
29 model))) 29 model)))
30
31 (defn load-blender-scene [^String model]
32 (.loadModel
33 (doto (asset-manager)
34 (.registerLoader BlenderLoader (into-array String ["blend"])))
35 model))
36
37 (defn load-blender-model
38 [^String model]
39 (.loadModel
40 (doto (asset-manager)
41 (.registerLoader BlenderModelLoader (into-array String ["blend"])))
42 model))
43
44
45 (defn worm
46 []
47 (.loadModel (asset-manager) "Models/anim/worm.mesh.xml"))
48
49
50 (defn worm
51 []
52 (.loadModel (asset-manager) "Models/Oto/Oto.mesh.xml"))
53
54
55
56 (defn test-worm-anim []
57
58 (let [the-worm (worm)
59 anim-control (.getControl (worm) AnimControl)
60 channel (doto (.createChannel anim-control)
61 (.addAllBones)
62 (.setLoopMode LoopMode/Loop))
63
64 play-anim
65 (fn [world pressed]
66 (if (not pressed)
67 (do
68 (println-repl "space is pressed")
69 (.setAnim channel "Walk"))))
70
71 ]
72
73 (.start
74 (world
75 (doto (Node.)
76 (.attachChild the-worm))
77 {"key-space" play-anim}
78 light-up-everything
79 no-op
80 )
81
82
83 )))
84
85
86
87
88
30 #+end_src 89 #+end_src
31 90
32 91
33 92
34 93