Problem with picking in JME3 + Android

Hello,

I implemented JME3 + Android in my project. It has an exception and I have been trying to find the problem for 3 weeks but I can’t find the solution, when I pick an object, the following exception occurs:



SEVERE AndroidHarness 12:21:29 PM Exception thrown in Thread[GLThread 765,5,main]: at com.jme3.util.TempVars.get(106)

07-03 12:21:29.320: E/AndroidHarness(6159): at com.jme3.bounding.BoundingBox.collideWithRay(723)

07-03 12:21:29.320: E/AndroidHarness(6159): at com.jme3.bounding.BoundingBox.collideWith(765)

07-03 12:21:29.320: E/AndroidHarness(6159): at com.jme3.collision.bih.BIHTree.collideWithRay(403)

07-03 12:21:29.320: E/AndroidHarness(6159): at com.jme3.collision.bih.BIHTree.collideWith(454)

07-03 12:21:29.320: E/AndroidHarness(6159): at com.jme3.scene.Mesh.collideWith(847)

07-03 12:21:29.320: E/AndroidHarness(6159): at com.jme3.scene.Geometry.collideWith(338)

07-03 12:21:29.320: E/AndroidHarness(6159): at com.jme3.scene.Node.collideWith(494)

07-03 12:21:29.320: E/AndroidHarness(6159): at org.collaviz.clientJME3Android.JMEPicking.pickObject(46)

07-03 12:21:29.320: E/AndroidHarness(6159): at org.collaviz.iivc.abstraction.A_Ray.pickObject(-1)

07-03 12:21:29.320: E/AndroidHarness(6159): at org.collaviz.iivc.abstraction.A_Cursor2DRay3D.scan(-1)

07-03 12:21:29.320: E/AndroidHarness(6159): at org.collaviz.iivc.abstraction.A_Cursor2DRay3D.processActionEvent(-1)

07-03 12:21:29.320: E/AndroidHarness(6159): at org.collaviz.iivc.abstraction.A_Tool$1.callback(-1)

07-03 12:21:29.320: E/AndroidHarness(6159): at org.collaviz.collaboration.objects.utils.CallbackDictionnary.call(-1)

07-03 12:21:29.320: E/AndroidHarness(6159): at org.collaviz.collaboration.objects.abstraction.A_SharedObject.callModificationMethod(-1)

07-03 12:21:29.320: E/AndroidHarness(6159): at org.collaviz.collaboration.objects.control.C_SharedObject.callModificationMethod(-1)

07-03 12:21:29.320: E/AndroidHarness(6159): at org.collaviz.collaboration.objects.control.client.CClient_SharedObject.callModificationMethod(-1)

07-03 12:21:29.320: E/AndroidHarness(6159): at org.collaviz.iivc.control.client.CClient_Tool.processActionEvent(-1)

07-03 12:21:29.320: E/AndroidHarness(6159): at org.collaviz.iivc.abstraction.A_Cursor2DRay3D.scan(-1)

07-03 12:21:29.320: E/AndroidHarness(6159): at org.collaviz.iivc.abstraction.A_Cursor2DRay3D.processActionEvent(-1)

07-03 12:21:29.320: E/AndroidHarness(6159): at org.collaviz.iivc.abstraction.A_Tool$1.callback(-1)

07-03 12:21:29.320: E/AndroidHarness(6159): at org.collaviz.collaboration.objects.utils.CallbackDictionnary.call(-1)



Here my code:



[java]

public class JMEPicking implements IPicking3D {



PJME3_ObjectManager objManager = null;

long id;

Node rootNode;



public JMEPicking(Node rootNode) {

this.rootNode = rootNode;

// TODO Auto-generated constructor stub

// Log.e("", “TEST IN PICKING OBJECT”);



}



public PJME3_ObjectManager getObjManager() {

return objManager;

}



@Override

public IC_SharedObject pickObject(Point3d origin3d, Vector3d direction3d,

double length) {



IC_SharedObject result = null;

CollisionResults results = new CollisionResults();

Vector3f originJme = new Vector3f((float) origin3d.x,

(float) origin3d.y, (float) origin3d.z);

Vector3f directionJme = new Vector3f((float) direction3d.x,

(float) direction3d.y, (float) direction3d.z);

Ray ray = new Ray(originJme, directionJme);

rootNode.collideWith(ray, results);

CollisionResult closest = null;

if (results.size() > 0) {

closest = results.getClosestCollision();

result =(IC_SharedObject)closest.getGeometry().getUserData(“controller”);

Log.e("", "RESULT "+closest.getGeometry().getUserData(“controller”));

return result;

}

return null;



}



@Override

public IC_SharedObject pickObject(Point3d origin, Vector3d direction) {

// TODO Auto-generated method stub



return pickObject(origin, direction, -10);

}

}



[/java]

You can help me, thank you

What is the exception / error message? What you posted there is just the stack trace.

I guess IndexArrayOutOfBound, it fails to get another TempVars. The limit is 5 and hard coded. Maybe we could bump that up.

@nehon said:
I guess IndexArrayOutOfBound, it fails to get another TempVars. The limit is 5 and hard coded. Maybe we could bump that up.

This isn't the case since the code works under normal circumstances, something else is wrong.

@vpham: Can we see the whole log including the exception itself, if possible?