I am using Pandora v1.9.0 , Ubuntu and the C++ API.
I have the same problem explained here: I cannot get the values of the pointer of the mouse using the MouseWatcher.
When I call the function mouseWatcher->has_mouse() I get always 0.
NodePath mouseNode = window->get_mouse();
MouseWatcher* mouseWatcher = dynamic_cast<MouseWatcher*>(mouseNode.node());
std::cout << "Has_mouse" << mouseWatcher->has_mouse() << std::endl;
here the complete code.
Instead If I use the function:
window->get_graphics_window()->get_pointer(0).get_x()
I get the correct result.
In Python the MouseWatcher is working properly (for example in the example Ball-in-Maze ).
# Read the mouse position and tilt the maze accordingly
if base.mouseWatcherNode.hasMouse():
mpos = base.mouseWatcherNode.getMouse() # get the mouse position
self.maze.setP(mpos.getY() * -10)
self.maze.setR(mpos.getX() * 10)
Any Idea?
Thank you in advance