# HG changeset patch # User Robert McIntyre # Date 1320340255 25200 # Node ID bc93abad23eec00a36ff68f98c35c56f0244c406 # Parent 2ce7400825c2ee0460c17a580cfa9f4c9f1028d5 moved usefull functions to util diff -r 2ce7400825c2 -r bc93abad23ee org/skin.org --- a/org/skin.org Thu Nov 03 10:03:22 2011 -0700 +++ b/org/skin.org Thu Nov 03 10:10:55 2011 -0700 @@ -112,8 +112,6 @@ (cortex.import/mega-import-jme3) -(import java.util.logging.Level) -(import java.util.logging.Logger) (use 'hello.brick-wall) @@ -183,15 +181,6 @@ (update-ray-debug (.getChild debug-node n) (nth rays n) (nth touch-data n)))))) - - -(defn no-logging [] - (.setLevel (Logger/getLogger "com.jme3") Level/OFF)) - -(defn set-accuracy [world new-accuracy] - (let [physics-manager (.getState (.getStateManager world) BulletAppState)] - (.setAccuracy (.getPhysicsSpace physics-manager) (float new-accuracy)))) - (defn transparent-sphere [] (doto (make-shape diff -r 2ce7400825c2 -r bc93abad23ee org/util.org --- a/org/util.org Thu Nov 03 10:03:22 2011 -0700 +++ b/org/util.org Thu Nov 03 10:10:55 2011 -0700 @@ -96,7 +96,10 @@ (:import com.jme3.math.ColorRGBA) (:import com.jme3.bullet.BulletAppState) (:import com.jme3.material.Material) - (:import com.jme3.scene.Geometry)) + (:import com.jme3.scene.Geometry) + (:import (java.util.logging Level Logger))) + + (defvar println-repl (bound-fn [& args] (apply println args)) @@ -124,6 +127,22 @@ BulletAppState)) (asset-manager))) +(defn no-logging + "Disable all of jMonkeyEngine's logging." + [] + (.setLevel (Logger/getLogger "com.jme3") Level/OFF)) + +(defn set-accuracy + "Change the accuracy at which the World's Physics is calculated." + [world new-accuracy] + (let [physics-manager + (.getState + (.getStateManager world) BulletAppState)] + (.setAccuracy + (.getPhysicsSpace physics-manager) + (float new-accuracy)))) + + (defn set-gravity "In order to change the gravity of a scene, it is not only necessary to set the gravity variable, but to \"tap\" every physics object in