Contributing

Hey,



Ive been learning and working with jME for some time now. I really like this engine and the amazing work that has been done.

(… more flattery here  :)).



At the moment Im working on InputHandler that would allow scrolling the camera on 2d plane, regardless of camera orientation. This type of handler would typically be useful for Strategy games. If you played any strategy games and moved your main view around using your mouse or keyboard then you know what Im talking about.

The problem I run into is that at some point the code has to check if the mouse is on the border of the window. However the AbsoluteMouse class does not have the getters for its width and hight variables. Of course it would be easy to make a copy of those variables and pass them around, but its not a nice and elegant solution.

So I would like to contribute the said InputHandler along with the addion of getters for the AbsoluteMouse class.

Aside from that I could do simple code maintenance, like adding missing get methods where they should be, adding comments and fixing bugs as I stumble upon them. Possibly contribute other reusable classes that could be part of the engine as I make them.



If my contribution is desired, let me know. Otherwise I ask for at least an addition of getWidth() and getHight() methods to the AbsoluteMouse class, if possible.

Thanx for reading this and keep up the good work!  :wink:

I've added accessors for width and height in my local source.  They'll be in cvs on the next checkin we do.



You might consider posting your input handler to the UserCode forum or the wiki.  Sounds like something that could be helpful for specific game types.

Probably can't offer much help with the development (though I can try) but I'd be interested in this controller as I am making a primarily 2D based strategy game.  One of my camera controllers will be an "orbit" controller around a given object, but it would be nice to offer a mode like you describe to lock the camera to a plane but allow free movement otherwise - perhaps within a set bounds.



Certainly willing to beta test once I can get back to development work on my game.

Thanx, for the fix!



Ill post the handler when its a bit more polished… right now it only scrolls along fixed axes regardless of camera rotation. Needs a bit more work.

I was looking at the InputHandler related code. jME seems to have a very elaborate input handling system, including ActionTriggers and SyntheticButtons just to name a few. However I could not find many useful examples on how to use ActionTriggers with jME.



Have you used ActionTrigger?

Was it meant to be used at the API-user level or was it meant mostly for the engine internals?



Share some thoughts please  :-o

Triggers are for internal use of the InputHandler and the devices. Usually subclassing the InputHandler is not necessary any more. It was the "old style" of implementing input stuff. With the new input system you'd usually only use the existing InputHandler class, action implementations, devices and probably synthetic buttons/axes. Only new devices would have to use the triggers themselves.

Thanx for the insight, Irrisor!



Though Ive already done most of the work by subclassing the input handler  :expressionless:

The synthetic axis and buttons business was too complicated for me to figure out with the lack of working examples.