Vector4f cannot be cast to Quaternion

hi , on android i sometimes get this error and sometimes not!
I dont even use Vector4f or quaternion in my code

i think if the error comes it happens when i detach an appstate if that is helpful…
(On pc it works fine)

We need to see the exception stack trace.

See for some general guidelines on problem reporting.

/AndroidHarness(23326): Exception thrown in Thread[GLThread 5794,5,main]
E/AndroidHarness(23326): java.lang.ClassCastException: com.jme3.math.Vector4f cannot be cast to com.jme3.math.Quaternion
E/AndroidHarness(23326): at
E/AndroidHarness(23326): at
E/AndroidHarness(23326): at
E/AndroidHarness(23326): at com.jme3.material.Material.renderMultipassLighting(
E/AndroidHarness(23326): at com.jme3.material.Material.render(
E/AndroidHarness(23326): at com.jme3.renderer.RenderManager.renderGeometry(
E/AndroidHarness(23326): at com.jme3.renderer.queue.RenderQueue.renderGeometryList(
E/AndroidHarness(23326): at com.jme3.renderer.queue.RenderQueue.renderQueue(
E/AndroidHarness(23326): at com.jme3.renderer.RenderManager.renderViewPortQueues(
E/AndroidHarness(23326): at com.jme3.renderer.RenderManager.flushQueue(
E/AndroidHarness(23326): at com.jme3.renderer.RenderManager.renderViewPort(
E/AndroidHarness(23326): at com.jme3.renderer.RenderManager.render(
E/AndroidHarness(23326): at
E/AndroidHarness(23326): at
E/AndroidHarness(23326): at
E/AndroidHarness(23326): at android.opengl.GLSurfaceView$GLThread.guardedRun(
E/AndroidHarness(23326): at android.opengl.GLSurfaceView$

This should be fixed in the nightly build

i updated but nothing changed

How did you update?
It’s definitely fixed in last nightly, so you might have made a mistake

mhm… in the sdk was a bubble “25 updates available” i clicked on that and so on…
is there another way?

Are you on the nightly updates or stables?

mhm how do i update “nightly”?
dont know where the differance is… :frowning:

oh ok
i read the manual and now it makes more sence to me :wink:

@TripleS said: oh ok i read the manual and now it makes more sence to me ;)

I think some of us just shed a little tear of joy… :wink:

i updated now and now it seems that the mouse coordinates go wild !!!(on Android)
i press somewhere but my joystick appears somewhere else and if i go up with the finger the stick goes down…

@iwgeric isn’t that the inverse mouse axis thing?

This happens to me when I have several lights. When I have one light which is the only situation I tested, the error goes away.

how can i invers the mouseaxis?
and how can i detect if its neccesary? Is this now general that the mouse need to be inversed ? or is this only on my device like this?

if( the app is on android ){


or how does this work??

In your Android source java file there are two lines:

   mouseEventsInvertX = true;

    mouseEventsInvertY = true;

You might want to tinker with them if you don’t find a more appropriate way to invert the axes.

At the time of the last stable update, the mouse coordinates for Android were the opposite of a mouse if you were using the simulated mouse events. This meant that users had to invert Y to get the touch coordinates to mimic mouse coordinates. A while ago the settings for invert X and Y were changed to have a default setting that matched the desktop mouse. Now, manually inverting the touch coordinates should not be necessary and the same app logic can apply to a desktop app or an android app.