New issue report by Daniels.Douglas:
Develop a scripting framework using Java 6's scripting engines that can be
used in games.
Primarily the focus will be on developing a script framework for the java
monkey engine.
Issue attributes:
Status: Accepted
Owner: Daniels.Douglas
Labels: Type-Task Priority-High
--
You received this message because you are listed in the owner
or CC fields of this issue, or because you starred this issue.
You may adjust your issue notification preferences at:
http://code.google.com/hosting/settings
Comment #1 by Daniels.Douglas:
Wiki page describing the framework with source code:
http://eventhorizongames.com/wiki/doku.php?id=articles:jmonkey_engine_scripting
Comment #3 by Daniels.Douglas:
Having a weird issue where the script was failing on the fromAngleNormalAxis call in
the javascript. The code would run fine in debug mode but not in regular mode.
Then it was working fine in both modes, but it ran 4 times faster in debug mode??
Does the script engine run a thread somewhere? Also does it optimize code for debug
mode??
Also groovy script doesn't work because it cannot resolve the global variables in the
spinController.groovy
----
import com.jme.math.Vector3f;
import com.jme.math.Quaternion;
def incr = 1.0f;
def rotVec = new Vector3f(0.0f, 1.0f, 0.0f);
def rotQuat = new Quaternion();
def angle = 0.0f;
def update(time, mesh) {
//update the angle
angle = angle + incr;
if (angle > 360) {
angle = 0;
}
rotQuat.fromAngleNormalAxis(angle * FastMath.DEG_TO_RAD, rotVec);
mesh.setLocalRotation(rotQuat);
}
-----
Stacktrace:
------
Caused by: org.codehaus.groovy.runtime.InvokerInvocationException:
groovy.lang.MissingPropertyException: No such property: angle for class: Script1
at org.codehaus.groovy.runtime.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:75)
at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:713)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:560)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:506)
at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:450)
at groovy.lang.Closure.call(Closure.java:188)
at com.sun.script.groovy.GroovyScriptEngine.callGlobal(GroovyScriptEngine.java:295)
at com.sun.script.groovy.GroovyScriptEngine.callGlobal(GroovyScriptEngine.java:289)
at com.sun.script.groovy.GroovyScriptEngine.invokeImpl(GroovyScriptEngine.java:278)
... 11 more
------