Wii remote working with TGE
by Rob Terrell · in Torque Game Engine · 12/14/2006 (9:01 pm) · 4 replies
I just posted this on my GG "blog" page so it's perhaps redundant, but since I have no idea how long those things take to get approved, I wanted to mention this here on the Mac forum.
I hacked some support for the Wii remote into TGE 1.5. Until the GG blog is approved, you can see the screenshot and Quicktime movie at [url]http://www.robterrell.com/?p=11[url].
Right now it listens to the motion sensor for X and Y axis movement, and translates that into SI_XAXIS and SI_YAXIS events that are fed in via Game->postEvent(event). I've started support for the A and B buttons but I wasn't sure if I should make them into some new kind of keypress, or map them onto an existing keyboard character. Right now, A = space and B = return.
It's using the Cocoa bluetooth objects, and there some weirdness left over from calling Cocoa from Carbon, but nothing too serious so far. But it's pretty ugly. The sample code I appropriated was ugly to start with... and I uglied it up a good bit more. Still, it seems to work really well.
I'm sure it's only a matter of time until someone does the same for Windows, but for now it's a rare TGE Mac-first.
Edit: and now the resource has gone live, so this is redundant. Sorry folks! http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=11880
I hacked some support for the Wii remote into TGE 1.5. Until the GG blog is approved, you can see the screenshot and Quicktime movie at [url]http://www.robterrell.com/?p=11[url].
Right now it listens to the motion sensor for X and Y axis movement, and translates that into SI_XAXIS and SI_YAXIS events that are fed in via Game->postEvent(event). I've started support for the A and B buttons but I wasn't sure if I should make them into some new kind of keypress, or map them onto an existing keyboard character. Right now, A = space and B = return.
It's using the Cocoa bluetooth objects, and there some weirdness left over from calling Cocoa from Carbon, but nothing too serious so far. But it's pretty ugly. The sample code I appropriated was ugly to start with... and I uglied it up a good bit more. Still, it seems to work really well.
I'm sure it's only a matter of time until someone does the same for Windows, but for now it's a rare TGE Mac-first.
Edit: and now the resource has gone live, so this is redundant. Sorry folks! http://www.garagegames.com/index.php?sec=mg&mod=resource&page=view&qid=11880
About the author
#2
12/14/2006 (9:31 pm)
Go get one. Actually, get the whole Wii. It's a lot of fun, and the pack-in game can help you understand the controller's limitations. Our local Target seems to get a shipment every week or so.
Torque Owner Gary "ChunkyKs" Briggs
Gary (-;