Picking not working anymore?

Hi, first of all, sorry for that kind of question, but I’m facing an odd problem with picking geometrys

The code is exactly the same as in the turorials, but it doesn’t work anymore (since about 3-4 days), even though I didn’t change the code…
The results.size() is always = 0

The reason why I’m posting this without knowing much about the issue is, that since I updated to the latest nightly, it doesn’t work anymore.
Maybe I’m just missing the problem, but I’ve been searching searching for days now.
I don’t know, how to change to an older version of jme to check whether this is a nightly-problem only,
so if one of you has the time, he may check if picking with a cursor works for him with the latest nightly.

the code:
[java]
CollisionResults results = new CollisionResults();
Vector2f click2d = inputManager.getCursorPosition();
Vector3f click3d = cam.getWorldCoordinates(
new Vector2f(click2d.x, click2d.y), 0f).clone();
Vector3f dir = cam.getWorldCoordinates(
new Vector2f(click2d.x, click2d.y), 1f).subtractLocal(click3d).normalizeLocal();
Ray ray = new Ray(click3d, dir);
rootNode.collideWith(ray, results);
System.out.print(results.size()); // <-always 0
[/java]
Thank you!

The TestMousePick in the repo works fine for me.
Can you try to test it on your end? It would rule out a nightly issue.

1 Like

Nice, using:
[java]Vector3f origin = cam.getWorldCoordinates(inputManager.getCursorPosition(), 0.0f);
Vector3f direction = cam.getWorldCoordinates(inputManager.getCursorPosition(), 0.3f);
direction.subtractLocal(origin).normalizeLocal();

    Ray ray = new Ray(origin, direction);
    CollisionResults results = new CollisionResults();[/java]

works perfectly fine!

Even though I don’t know, why my “old” code stopped working, the problem is solved.