Force feedback example?

rvangaal
Unregistered
 
Post: #1
Hi all,

I would like to add force feedback to my racing sim, but the FF SDK seems in its infancy. Does anyone have a small example program, or is there any by now on some website?
An extract would do nice as well, most probably...

I did go through the entire HID thing, to get axis values out of a game controller, so that code is all there. It might be just a matter of writing values to the HID device, but since the HID input code was already so obscure and abstract (compared to what it does), just guessing for HID output code seems a dead end.

Thanks.
Quote this message in a reply
Member
Posts: 116
Joined: 2002.04
Post: #2
Apple has a FF SDK which has not been released due to legal wrangling over who has rights to what.

So, you're pretty much stuck until it's released, unless you have a contact inside of Apple.

Wade
Quote this message in a reply
Member
Posts: 104
Joined: 2002.04
Post: #3
Quote:Originally posted by rvangaal
Hi all,


I did go through the entire HID thing, to get axis values out of a game controller, so that code is all there. It might be just a matter of writing values to the HID device, but since the HID input code was already so obscure and abstract (compared to what it does), just guessing for HID output code seems a dead end.

Thanks.


Be careful trying that, I ruined two controllers trying to do that very thing. Wait for the SDK if you can.
Quote this message in a reply
rvangaal
Unregistered
 
Post: #4
Thanks for the writing warning!

I do have a latest beta SDK which has documentation, I've found. Now it's a matter of getting a USB force device to test with.

I think the original FF implementation was in 10.2.3; I did get a later SDK from a contact though indeed. Has a nice testing app inside to test all the calls and see if the wheel responds. Unfortunately my ActLabs ForceRS (PC originally) isn't recognized by even the HID Explorer. PRobably doesn't do the HID protocol.
Quote this message in a reply
rvangaal
Unregistered
 
Post: #5
Just for the interest; I've bought a Logitech Wingman Formula Force GP yesterday; it's recognized, although the controls funnily are nested a bit strangely; it has all its controls under an 'X-axis' node. So the buttons are X-axis/Button 1 etc, and the axes are X-axis/X-axis and X-axis/Y-axis (in HID Explorer).

Had to adjust some code to find the cookies for that correctly. My only other wheel (a Modena 360 Pro, which has no FF) has the controls just neatly in an array, without going into a deeper dictionary.

I then just did a FFCreateDevice() and FFDeviceCreateEffect() (and FFEffectStart()) and that worked quite quickly. It's weird how they kind of took over MS' DirectInput coding style (with effect.dwAxes[] and such) so directly.
Anyway, it should be a breeze to integrate a bit neater into my joystick class in the same way as I encapsulated DirectInput, as the code is just about the same.

Good to see the wheel moving. After HID, the FF api is quite a bit better (although I must confess I had experience with DirectInput, so in the end it's not really all that clean, but very recognizable).
Quote this message in a reply
rvangaal
Unregistered
 
Post: #6
It all works now, including a couple of effect types.

You can feel the result in the Mac edition of Racer v0.5.0 beta 11, see:

http://forum.racesimcentral.com/showthre...adid=68910
Quote this message in a reply
Member
Posts: 116
Joined: 2002.04
Post: #7
Quote: It's weird how they kind of took over MS' DirectInput coding style (with effect.dwAxes[] and such) so directly.

That's actually brilliant. For any game coming over from Windows (and most of the big ones are), it takes very little work to adapt your FF code to the Mac.

Wade
Quote this message in a reply
rvangaal
Unregistered
 
Post: #8
It was indeed mostly just a copy & paste, search & replace DI -> FF.

On the other hand, that did mean they also took over some of the things I like less about MS programming style; the 'DWORD dwFlags' type of thing.
Not that I found HID to have a particularly readable interface though. Wink
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Force Touch Events? Ropeburn 12 9,620 Feb 9, 2011 11:47 PM
Last Post: omarmaris
  Integrating Force And Torque Nick 5 3,734 Oct 23, 2006 10:03 AM
Last Post: Skorche
  Is Force Feedback broken in Tiger? Andrew 3 3,595 Aug 23, 2005 03:59 AM
Last Post: Andrew