On touch event bug

Here i’m again with same problem
[java]
E/com.jme3.app.AndroidHarness(12278): SEVERE Exception thrown in Thread[GLThread 1026,5,main]
E/com.jme3.app.AndroidHarness(12278): java.lang.NullPointerException
E/com.jme3.app.AndroidHarness(12278): at com.jme3.collision.bih.BIHTree.<init>(BIHTree.java:117)
E/com.jme3.app.AndroidHarness(12278): at com.jme3.collision.bih.BIHTree.<init>(BIHTree.java:130)
E/com.jme3.app.AndroidHarness(12278): at com.jme3.scene.Mesh.createCollisionData(Mesh.java:885)
E/com.jme3.app.AndroidHarness(12278): at com.jme3.scene.Mesh.collideWith(Mesh.java:905)
E/com.jme3.app.AndroidHarness(12278): at com.jme3.scene.Geometry.collideWith(Geometry.java:408)
E/com.jme3.app.AndroidHarness(12278): at com.jme3.scene.Node.collideWith(Node.java:494)
E/com.jme3.app.AndroidHarness(12278): at com.jme3.scene.Node.collideWith(Node.java:494)
E/com.jme3.app.AndroidHarness(12278): at com.jme3.scene.Node.collideWith(Node.java:494)
E/com.jme3.app.AndroidHarness(12278): at tonegod.gui.core.Screen.getContactElement(Screen.java:1410)
E/com.jme3.app.AndroidHarness(12278): at tonegod.gui.core.Screen.androidTouchDownEvent(Screen.java:1019)
E/com.jme3.app.AndroidHarness(12278): at tonegod.gui.core.Screen.onTouchEvent(Screen.java:1004)
E/com.jme3.app.AndroidHarness(12278): at com.jme3.input.InputManager.processQueue(InputManager.java:813)
E/com.jme3.app.AndroidHarness(12278): at com.jme3.input.InputManager.update(InputManager.java:883)
E/com.jme3.app.AndroidHarness(12278): at com.jme3.app.Application.update(Application.java:604)
E/com.jme3.app.AndroidHarness(12278): at com.jme3.app.SimpleApplication.update(SimpleApplication.java:231)
E/com.jme3.app.AndroidHarness(12278): at com.jme3.app.AndroidHarness.update(AndroidHarness.java:467)
E/com.jme3.app.AndroidHarness(12278): at com.jme3.system.android.OGLESContext.onDrawFrame(OGLESContext.java:349)
E/com.jme3.app.AndroidHarness(12278): at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1524)
E/com.jme3.app.AndroidHarness(12278): at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1248)
[/java]

this time i have used your game,
My mobile device Samsung Galaxy Grand Neo
Android 4.2.2

[video]Android issue on touch event - YouTube

1 Like

sorry for my bad english

@SetasSan said: this time i have used your game, My mobile device Samsung Galaxy Grand Neo Android 4.2.2

Ok… I think this issue is resolved with the last changes to the Android harness for JME, but won’t be available until the next stable release. In the mean time, I’ll see what I can do about figuring out a way to solve this issue. I’m not sure this will be an automatic fix as it will require communication between your main activity and the JME app.

I’ll have a look at this today and see what I am able to come up with.

1 Like

@SetasSan
I have an idea thatmay solve the issue.

Right after you call initialize on the AnimElement, call animElement.update(0); and see if you still get this error. If so, I may be able to fix this internally to the library.

EDIT: I’'m fairly sure this may be related to this issue. I started poking around in the update loop of AnimElement and it looks like the mesh.update(0) and geom.updateModelBounds() call was being made at the beginning of the method as apposed to the end. I’ll run some tests here with the test game I just published and see if I can remove the fix above and have it still run properly.

1 Like

awesome, after two weeks of frustration it is working now(animElement.update(0) is a solution). Thank you.

1 Like
@SetasSan said: awesome, after two weeks of frustration it is working now(animElement.update(0) is a solution). Thank you.

I will try to figure out a way to get this into the library that works for all solutions. I’ve hit a few where the mesh (I think) isn’t flagged properly for update until after the method returns /boggle. As soon as I am able to fix this internally I’ll let you know so you won’t have to do this manually.

1 Like