-
Notifications
You must be signed in to change notification settings - Fork 60
Force direction is backwards #36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I just tried changing the diection of angle_ratio:
And now the direction of forces seem consistent, and spring centering and damping still work. I'm guessing that's because the The Microsoft documentation says that an angle of 0 is the -y axis, and rotations are clockwise. That means that a rotation of 90 degrees should fall on the positive x axis. My tweak to angle ratio above therefore seems to make sense: For the X axis: For the Y axis: |
Hi, im having same problem. How and where i have to add the code you writed (float angle_ratio = axis == 0 ? -sin(angle) : cos(angle);) in SingleJoystickFFB code which is provided by the YukMingLaw? I am using it with just pwm correction for avoiding dc motor noise which i found before. There is no change in that code because i am noob level on coding and sorry for may bad english :)) i hope i have explained my problem. And are you sharing your code in anywhere? I would like to receive inspiration from your code too. Thanks a lot. |
Hi again. I have found where to add it. Thanks anyway :)) |
It's possible I'm using the library wrong, but I've spent several hours trying to debug this.
I've noticed that, in games that use constant forces to do their own feedback, the direction of the force is in the wrong direction. This obviously makes the games unplayable. Spring forces, friction and damping all seem to work correctly though.
When I use the program "ForceTest" to inject a constant force, the direction is indeed backwards from what Microsoft's documentation says the convention is. https://docs.microsoft.com/en-us/previous-versions/windows/desktop/ee417536(v=vs.85)
A force of "60" with a direction of "90" should come from the direction of positive X, which on my steering wheel should push counterclockwise. I get a clockwise force instead, though.
Likewise, when I do a periodic force, the wheel is forced clockwise and then counterclockwise.
The text was updated successfully, but these errors were encountered: