Wow this is really great, I've been wanting to make a stategy game for a while and this takes some of the hard work out of it (I originaly started using soya3d a python 3d engine but after finding out about jmonkey it's out the door) I still have to learn more about java and jme but this has gotten me off to a running start. Thanks a lot.
So the update method has to query the terrainPage for those two hight values. Alternatively you can inject those two values before calling the update method. Either way, some modification to the update method and update sequence are needed. Yet another way is make all the transformations to the camera in game's update method, instead of controller's update method…
I've added some more features to strategicHandler, as well as done some overall polish…
demo with terrain
code to adjust camera height based on terrain
mouse input filter while rotating view with the mouse
input filters for keyboard rotation and zoom
all the configuration code is there, everything is now fully configurable
overall code improvements
a very good set of defaults
The source code and binaries are now in two separate archives. Also the binaries are compiled for Java 5 (last version was compiled for Java 6 and I realize some people might not have it… my bad). I have also included a readme file.
The most likely problem is that you are not setting a cursor. You have to set a cursor every frame to clear any remaining states. This is done so you can change cursors based on picking. Otherwise the cursor would have been set twice: once to restore a previous state and once to apply a new state. And there is a somewhat large overhead when setting a harware cursor (you don't want to do it twice if avoidable) and the harware cursor tends to flicker when changed on linux, so changing it twice would have given too much flickering.
Look how its done in demo it has a big comment section saying "Remember to update your cursor every frame."
If that dosent resolve a problem then something very strange is going on… And to fix it, I need to replicate the problem first. So give me as much details as possible when the problem occurs.
How often does it occur? (Always, Sometimes, Rarely).
Do you have to press anything else for that to occur? (Any keys on keyboard, any mouse buttons)?
Are you following the object, object rotation when that occurs?
Are you using hardware mouse or software mouse when that occurs?
Does the same thing happens when using press CTRL key?
What version of jme you are using (release # or from CVS)?
Does it occur in the included demo or in your own code where you are trying to integrate the handler?
Also you can check if the mouseInput is reporting your button as being pressed using