Hello all,
When the user put the mouse over a brown square, the square is red enlightened. Everything work like a charm…
Recently a try to add some hud with the help of nifty.
When the user move the mouse over a nifty panel and if a brown square is “under” this panel. The square is enlightened…
How can I “say” :
[java]
if (the mouse is over a nifty Panel) {
DISABLE PickingManager AppState
}
else {
ENABLE PickingManager AppState
}
[/java]
I don’t know if this is possible because my hud screen is composed of two panel :
http://i.imgur.com/bh8J4.png
Here is my nifty declaration made in a AppState - ScreenController :
[java]
NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay(assetManager, inputManager, app.getAudioRenderer(), app.getGuiViewPort());
nifty = niftyDisplay.getNifty();
nifty.fromXml(“Interface/Nifty/gui.xml”, “hud”, this);
app.getGuiViewPort().addProcessor(niftyDisplay);
[/java]
I try with “GuiViewPort()” and “ViewPort()” with the same result.
Here is my PickingManager update loop that I want to disable :
[java]
// results list.
CollisionResults results = new CollisionResults();
// the ray from cam loc to mouse
Vector3f origin = app.getCamera().getWorldCoordinates(inputManager.getCursorPosition(), 0.0f);
Vector3f direction = app.getCamera().getWorldCoordinates(inputManager.getCursorPosition(), 0.3f);
direction.subtractLocal(origin).normalizeLocal();
Ray ray = new Ray(origin, direction);
if (results.size() > 0) {
CollisionResult closest = results.getClosestCollision();
stateManager.getState(GameManager.class).highlightHole(closest.getGeometry().getName());
}
[/java]
I realize I am not very clear, sorry.
Thanks.
Pierre