Hello everybody.
I have a small problem here, the image below shows my current small project. The numerated rectangles are made with jme, they are drag’n’dropable and clickable. Everything works nice on my windows machine.
Tomorrow i need to make a small prototype presentation to see if my idea gets approved. For the presentation i have borrowed my sisters macbook. At first try everything seems to work. Beside the gui responds a little slow. Thats however not a problem.
The big problem is that the mouse position has an offset. If i would like to click on the rectange 5, i have to click on the area marked in red.
What could possible cause the problem on osx?
http://i.imgur.com/NRh49.png
My selection code if fairly simple:
[java]
if (name.equals(“MoveWiese”)) {
if (keyPressed) {
CollisionResults results = new CollisionResults();
Vector2f click2d = app3d.getInputManager().getCursorPosition();
Vector3f click3d = new Vector3f(app3d.getInputManager().getCursorPosition().x, app3d.getInputManager().getCursorPosition().y, -1000);
Vector3f dir = Vector3f.UNIT_Z;
Ray ray = new Ray(click3d, dir);
app3d.getGuiNode().collideWith(ray, results);
if (results.size() > 0) {
currentMoveSelection = results.getClosestCollision().getGeometry().getParent();
currentMoveSelectionOffset = results.getClosestCollision().getContactPoint().clone().subtractLocal(currentMoveSelection.getWorldTranslation());
System.out.println(“Selection:” + currentMoveSelectionOffset.x + “:” + currentMoveSelectionOffset.y);
}
} else {
if(currentMoveSelection!=null){
((ZFarmerWiesenVisualisierer3dPluginWiesenControl) currentMoveSelection.getControl(ZFarmerWiesenVisualisierer3dPluginWiesenControl.class)).storeData();
}
currentMoveSelection = null;
}
}
[/java]