Mercurial > cortex
comparison org/body.org @ 176:026f69582022
organized imports in cortex.body
author | Robert McIntyre <rlm@mit.edu> |
---|---|
date | Sat, 04 Feb 2012 06:52:47 -0700 |
parents | 0b9ae09eaec3 |
children | d5c597a7aed4 |
comparison
equal
deleted
inserted
replaced
175:0b9ae09eaec3 | 176:026f69582022 |
---|---|
7 | 7 |
8 * Making a solid, connected body. | 8 * Making a solid, connected body. |
9 #+name: joints | 9 #+name: joints |
10 #+begin_src clojure | 10 #+begin_src clojure |
11 (ns cortex.body | 11 (ns cortex.body |
12 "Assemble a physical creature using the definitions found in a | |
13 specially prepared blender file. Creates rigid bodies and joints so | |
14 that a creature can have a physical presense in the simulation." | |
15 {:author "Robert McIntyre"} | |
12 (:use (cortex world util sense)) | 16 (:use (cortex world util sense)) |
17 (:use clojure.contrib.def) | |
13 (:import | 18 (:import |
14 com.jme3.math.Vector3f | 19 (com.jme3.math Vector3f Quaternion Vector2f Matrix3f) |
15 com.jme3.math.Quaternion | 20 (com.jme3.bullet.joints |
16 com.jme3.math.Vector2f | 21 SixDofJoint Point2PointJoint HingeJoint ConeJoint) |
17 com.jme3.math.Matrix3f | |
18 com.jme3.bullet.control.RigidBodyControl | 22 com.jme3.bullet.control.RigidBodyControl |
19 com.jme3.collision.CollisionResults | 23 com.jme3.collision.CollisionResults |
20 com.jme3.bounding.BoundingBox | 24 com.jme3.bounding.BoundingBox |
21 com.jme3.scene.Node)) | 25 com.jme3.scene.Node |
22 | 26 com.jme3.scene.Geometry |
23 (use 'clojure.contrib.def) | 27 com.jme3.bullet.collision.shapes.HullCollisionShape)) |
24 (cortex.import/mega-import-jme3) | |
25 | 28 |
26 (defn joint-targets | 29 (defn joint-targets |
27 "Return the two closest two objects to the joint object, ordered | 30 "Return the two closest two objects to the joint object, ordered |
28 from bottom to top according to the joint's rotation." | 31 from bottom to top according to the joint's rotation." |
29 [#^Node parts #^Node joint] | 32 [#^Node parts #^Node joint] |
218 particulars of the joints and the masses of each pody part are | 221 particulars of the joints and the masses of each pody part are |
219 determined in blender." | 222 determined in blender." |
220 [#^Node creature] | 223 [#^Node creature] |
221 (physical! creature) | 224 (physical! creature) |
222 (joints! creature)) | 225 (joints! creature)) |
223 | |
224 | |
225 | |
226 | |
227 #+end_src | 226 #+end_src |
228 | 227 |
229 #+results: joints | 228 #+results: joints |
230 : #'cortex.body/body! | 229 : #'cortex.body/body! |
231 | 230 |