comparison org/util.org @ 363:9fa92af29c3a

saving ...
author Robert McIntyre <rlm@mit.edu>
date Thu, 07 Mar 2013 05:36:17 +0000
parents 2e7d786241d3
children 4c37d39a3cf6
comparison
equal deleted inserted replaced
362:4b229dc028b6 363:9fa92af29c3a
274 (let [asset-manager (asset-manager) 274 (let [asset-manager (asset-manager)
275 mat (Material. asset-manager (:material d)) 275 mat (Material. asset-manager (:material d))
276 geom (Geometry. (:name d) (:shape d))] 276 geom (Geometry. (:name d) (:shape d))]
277 (if (:texture d) 277 (if (:texture d)
278 (let [key (TextureKey. (:texture d))] 278 (let [key (TextureKey. (:texture d))]
279 ;;(.setGenerateMips key true) 279 (.setGenerateMips key true)
280 ;;(.setTexture mat "ColorMap" (.loadTexture asset-manager key)) 280 (.setTexture mat "ColorMap" (.loadTexture asset-manager key))
281 )) 281 ))
282 (if (:color d) (.setColor mat "Color" (:color d))) 282 (if (:color d) (.setColor mat "Color" (:color d)))
283 (.setMaterial geom mat) 283 (.setMaterial geom mat)
284 (if-let [rotation (:rotation d)] (.rotate geom rotation)) 284 (if-let [rotation (:rotation d)] (.rotate geom rotation))
285 (.setLocalTranslation geom (:position d)) 285 (.setLocalTranslation geom (:position d))
396 ([node] 396 ([node]
397 (fn [game value] 397 (fn [game value]
398 (if (not value) 398 (if (not value)
399 (let [camera (.getCamera game) 399 (let [camera (.getCamera game)
400 cannon-ball 400 cannon-ball
401 (sphere 0.7 401 (sphere 0.4
402 ;;:texture nil
402 :material "Common/MatDefs/Misc/Unshaded.j3md" 403 :material "Common/MatDefs/Misc/Unshaded.j3md"
403 :color ColorRGBA/White 404 :color ColorRGBA/Blue
404 :name "cannonball!" 405 :name "cannonball!"
405 :position 406 :position
406 (.add (.getLocation camera) 407 (.add (.getLocation camera)
407 (.mult (.getDirection camera) (float 1))) 408 (.mult (.getDirection camera) (float 1)))
408 :mass 3)] ;200 0.05 409 :mass 25)] ;200 0.05
409 (.setLinearVelocity 410 (.setLinearVelocity
410 (.getControl cannon-ball RigidBodyControl) 411 (.getControl cannon-ball RigidBodyControl)
411 (.mult (.getDirection camera) (float 50))) ;50 412 (.mult (.getDirection camera) (float 50))) ;50
412 (add-element game cannon-ball (if node node (.getRootNode 413 (add-element game cannon-ball (if node node (.getRootNode
413 game))) 414 game)))