rotationSpeed, value or axis is null (mat cannot be, I can see that)
if you right-click the “Matrix3f” class in the editor and select “show source” you can find out that on line 742 the following happens:
[java] float fX2 = axis.x * axis.x;
[/java]
…which leads us to the conclusion that axis is null in this case.
Edit: … and actually, the exception would have happened in that line if rotationSpeed or value had been null, so you don’t even need to look into the Matrix3f source… But its helpful anyway
Sorry did not realize that was called the stack trace. I have never been asked for it before probably because I almost always provide it in my origional post.
SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
java.lang.NullPointerException
at GameCore.BasicGame.simpleInitApp(BasicGame.java:84)
at com.jme3.app.SimpleApplication.initialize(SimpleApplication.java:228)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.initInThread(LwjglAbstractDisplay.java:129)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:205)
I figured out that issue I forgot to initialize the control to it was just a reference. Now I am back to the null pointer exception that I was fighting before I switched the game controls into a control class.
[java]
SEVERE: Uncaught exception thrown in Thread[LWJGL Renderer Thread,5,main]
java.lang.NullPointerException
at com.jme3.math.Matrix3f.fromAngleNormalAxis(Matrix3f.java:742)
at GameCore.PlayerMoveControl.rotatePlayer(PlayerMoveControl.java:214)
at GameCore.PlayerMoveControl.onAnalog(PlayerMoveControl.java:150)
at com.jme3.input.InputManager.invokeAnalogsAndActions(InputManager.java:279)
at com.jme3.input.InputManager.onMouseMotionEventQueued(InputManager.java:377)
at com.jme3.input.InputManager.processQueue(InputManager.java:797)
at com.jme3.input.InputManager.update(InputManager.java:851)
at com.jme3.app.Application.update(Application.java:598)
at com.jme3.app.SimpleApplication.update(SimpleApplication.java:233)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.runLoop(LwjglAbstractDisplay.java:149)
at com.jme3.system.lwjgl.LwjglDisplay.runLoop(LwjglDisplay.java:182)
at com.jme3.system.lwjgl.LwjglAbstractDisplay.run(LwjglAbstractDisplay.java:223)
I can’t seem to find where the exception is coming from I have looked into value and rotationSpeed but it appears to be impossible for either to be null. The rotation speed is a constant and value is controlled by the engine and as far as I can tell will never be null.
Thanks
Edit: found the problem.
This NPE was caused by another null object, the initialUpVector, I have moved this code around so much that I lost a declaration.