diff --git a/jme3-core/src/main/java/com/jme3/scene/debug/custom/ArmatureDebugAppState.java b/jme3-core/src/main/java/com/jme3/scene/debug/custom/ArmatureDebugAppState.java index 51489a2bf5..6b14b49811 100644 --- a/jme3-core/src/main/java/com/jme3/scene/debug/custom/ArmatureDebugAppState.java +++ b/jme3-core/src/main/java/com/jme3/scene/debug/custom/ArmatureDebugAppState.java @@ -40,6 +40,7 @@ import com.jme3.input.controls.*; import com.jme3.light.DirectionalLight; import com.jme3.math.*; +import com.jme3.renderer.Camera; import com.jme3.renderer.ViewPort; import com.jme3.scene.*; @@ -158,8 +159,11 @@ public void onAction(String name, boolean isPressed, float tpf) { Vector2f click2d = app.getInputManager().getCursorPosition(); CollisionResults results = new CollisionResults(); - Vector3f click3d = app.getCamera().getWorldCoordinates(new Vector2f(click2d.x, click2d.y), 0f, tmp); - Vector3f dir = app.getCamera().getWorldCoordinates(new Vector2f(click2d.x, click2d.y), 1f, tmp2).subtractLocal(click3d); + Camera camera = app.getCamera(); + Vector3f click3d = camera.getWorldCoordinates(click2d, 0f, tmp); + Vector3f dir = camera.getWorldCoordinates(click2d, 1f, tmp2) + .subtractLocal(click3d) + .normalizeLocal(); Ray ray = new Ray(click3d, dir); debugNode.collideWith(ray, results);