|
What's the desired behaviour here? I presume that you don't want to be able to assign Y to yaw and X to pitch - but perhaps you might want to (when using pitch/yaw on a joystick) assign Y on mouse to absolute throttle, or "freelook" with mouse, or up/down/left/right "sidethrust" on the mouse? To be honest, I think my examples sound a bit contrived.
Also - should this wait until after SDL for Windows is in trunk? |
|
|
This definitely sounds like a thing we should resolve when we go for SDL everywhere to me. |
|
|
Agreed. |
|
|
axis_fix.patch (1,042 bytes)
Index: playercontrol.cpp
===================================================================
--- playercontrol.cpp (revision 11268)
+++ playercontrol.cpp (working copy)
@@ -637,22 +637,22 @@
if (Axis_map_to[JOY_HEADING_AXIS] >= 0) {
// check the heading on the x axis
if ( check_control(BANK_WHEN_PRESSED) ) {
- delta = f2fl( axis[JOY_HEADING_AXIS] );
+ delta = f2fl( axis[Axis_map_to[JOY_HEADING_AXIS]] );
if ( (delta > 0.05f) || (delta < -0.05f) ) {
ci->bank -= delta;
}
} else {
- ci->heading += f2fl( axis[JOY_HEADING_AXIS] );
+ ci->heading += f2fl( axis[Axis_map_to[JOY_HEADING_AXIS]] );
}
}
// check the pitch on the y axis
if (Axis_map_to[JOY_PITCH_AXIS] >= 0) {
- ci->pitch -= f2fl( axis[JOY_PITCH_AXIS] );
+ ci->pitch -= f2fl( axis[Axis_map_to[JOY_PITCH_AXIS]] );
}
if (Axis_map_to[JOY_BANK_AXIS] >= 0) {
- ci->bank -= f2fl( axis[JOY_BANK_AXIS] ) * 1.5f;
+ ci->bank -= f2fl( axis[Axis_map_to[JOY_BANK_AXIS]] ) * 1.5f;
}
// axis 2 is for throttle
|
|
|
I might be missing something, but according to my tests the attached patch should fix the issue in trunk, and allow binding any of pitch/yaw/bank to any axis. |
|
|
Fix committed to zookeeper@11275. |
|