Talk:Using OIS        


Notes


  • If this manager turns out to become 'big', it might be handy to give a more extensive explaination about using the manager ;).
  • Might want to add a method "applyForceFeedback( int joystickIndex, int amountOfForce )"
  • Might want to edit 'initialise( Ogre::RenderWindow *renderWindow )' to
    • 'initialise( Ogre::RenderWindow *renderWindow, bool initKeyboardAndMouse, bool initJoysticks )' or
    • 'initialise( Ogre::RenderWindew *renderWindow, const DeviceType )' (some enum).
    • Anyway the purpose is to make the programmer decide which inputdevices to initialise, that way you save some memory space and some event calls. It would also be possible to switch devices during runtime.
  • After editing plz check the code for errors






Edits


  • I realigned some code and did a check: it was missing an include, also atm it doesn't return a joystick and some more things like the iterators needed to be fixed.
  • Added remove listeners and some code changes here and there
  • I made a simple change to the joystick include, as on Linux, it is case sensitive, and I had named it OISJoyStick .h (and class JoyStick) (just a touch of style really) :-)
  • Removed the ForceFeedback part from the Manager (after talking to OvermindDL1), because it wasn't used atm. Next to that I also did some small optimisations like the constructor list. Also I renamed a few things to be more OGRE like :P (sName -> instanceName for example)
  • Added a check at 'getJoystick( index )' the manager would crash if the index was invalid (ie. no joysticks or the index is to high)
  • Added an example (download) for the masses to look at.
  • Changed the URL of the example download to something that works.






Questions


  • Any forcefeedback methods going back in?
  • I don't have any methods planned atm mainly because of two reasons, I wanted to keep the manager simple and most of the time you want to 'tie' a forcefeed back event to an action event. So then I would say do the forcefeed back stuff in your actionmap/manager. But if you know a good simple way to add it then please do :-D. If you want to see the code that was used before it was removed, simply go look at the history of the page and copy paste it.

  • How do you replace the existing input manager in Ogre? How do you delete the input manager? How do you capture before every frame? These things would make this HowTo much better. Sure, you can find info on these topics elsewhere, but without linking to those said solutions, or explaining here you leave beginners to Ogre and programming in general on the edge of a cliff...
  • This was kinda intended as a code snippet, so I expect ppl to kinda know what to do with it. But I did add an example just for completeness sake. I would be happy to buff this snippet up a bit and make it a mini article. But I'm thinking would there be enough interest (in the future that is)? 'pjcast is already implementing OIS in OGRE :-). Anyways atm I'm busy with a project, I'll go link hunting when I got the time for it.