Sandeep Puri
unread,Apr 11, 2008, 1:15:25 AM4/11/08Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Clojure
Hi all,
Quite new to clojure. Maybe I'm doing something wrong here. I was
trying to run a simple test of the jmonkey game libraries.
This is the simple java source:
public class HelloWorld extends SimpleGame{
public static void main(String[] args) {
HelloWorld app = new HelloWorld(); // Create Object
// Signal to show properties dialog
app.setDialogBehaviour(SimpleGame.ALWAYS_SHOW_PROPS_DIALOG);
app.start(); // Start the program
}
protected void simpleInitGame() {
// Make a box
Box b = new Box("Mybox", new Vector3f(0,0,0), new Vector3f(1,1,1));
rootNode.attachChild(b); // Put it in the scene graph
}
}
In clojure I have,
(def app (doto (proxy [SimpleGame] []
(simpleInitGame []
(let [rt (. this rootNode)]
(. rt (attachChild
(new Box
"mybox"
(new Vector3f 0 0 0)
(new Vector3f 1 1
1)))))))
(setDialogBehaviour 2)))
(. app (start))
I get java.lang.IllegalArgumentException: No matching field found:
rootNode
at clojure.lang.Reflector.getInstanceField(Reflector.java:189)
rootNode should be inherited from SimpleGame (which actually inherits
from another class BaseSimpleGame.
Any help in pointing me in the right direction would be appreciated.