Open GoogleCodeExporter opened 9 years ago
Wiki page describing the framework with source code:
http://eventhorizongames.com/wiki/doku.php?id=articles:jmonkey_engine_scripting
Original comment by Daniels....@gmail.com
on 22 Mar 2007 at 6:06
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??
Original comment by Daniels....@gmail.com
on 22 Mar 2007 at 6:07
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
------
Original comment by Daniels....@gmail.com
on 22 Mar 2007 at 6:10
Original issue reported on code.google.com by
Daniels....@gmail.com
on 22 Mar 2007 at 4:31