Integrating WiimoteLib into my TorqueX 3D game
by Matt Nicholson · in Torque X 3D · 10/18/2009 (6:44 pm) · 0 replies
So I'm starting off with the fantabulous FPSDemo as the basis of my game. My game will be Windows only, no Xbox 360 version. My plan is to make use of the Nintendo Wii Remote as the controller. I have been tinkering around with C# WiimoteLib by Brian Peek ( http://wiimotelib.codeplex.com/ ). I want to mod FPSDemo to be controllable with the Wii remote using this library. My game will be very different from FPSDemo in the end, but I'm starting out with just figuring out how to map Wii remote controls to the FPSDemo as is.
I see the FPSPlayerInputComponent implements the _SetupInput method of T3DInputComponent, I figure this is where I need to put my control mappings. I also figure that the 'gamepad' parameter contains the device ID for the gamepad.
What I can't seem to find is where the device ID is defined within the FPSDemo project.
Also, the objectId parameter. I see how it's being used but I can't tell how a GamePadObjects instance is being converted to an int. Is the int conversion actually some standardized hardware thing kind of like deviceId but representing a specific component in the device? I also have some code snippets that accesses the Wii remote through the .NET hardware layer, though I haven't delved too deep into it.
Finally, am I on the right track here? Any info would be very much appreciated.
I see the FPSPlayerInputComponent implements the _SetupInput method of T3DInputComponent, I figure this is where I need to put my control mappings. I also figure that the 'gamepad' parameter contains the device ID for the gamepad.
What I can't seem to find is where the device ID is defined within the FPSDemo project.
Also, the objectId parameter. I see how it's being used but I can't tell how a GamePadObjects instance is being converted to an int. Is the int conversion actually some standardized hardware thing kind of like deviceId but representing a specific component in the device? I also have some code snippets that accesses the Wii remote through the .NET hardware layer, though I haven't delved too deep into it.
Finally, am I on the right track here? Any info would be very much appreciated.
About the author
C# developer since 2002. Amateur musician. In the process of making my first XNA game with TorqueX 3D under the moniker Rhombus Games. Hardcore Seattle Sounders FC fan.