View Issue Details

IDProjectCategoryView StatusLast Update
0002436FSSCPgameplaypublic2015-03-05 22:25
Reporteriss_mneur Assigned To 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.7.2 
Summary0002436: Mouse controls ignore the axis binds
DescriptionIt doesn't seem to matter where you have the Joystick/Mouse X Axis or the Joystick/Mouse Y Axis is bound to. The mouse movement on the Y axis is always pitch and movement on the X axis is always yaw.
TagsNo tags attached.

Activities

niffiwan

2012-12-26 09:09

developer   ~0014577

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?

The_E

2012-12-27 12:31

administrator   ~0014579

This definitely sounds like a thing we should resolve when we go for SDL everywhere to me.

iss_mneur

2012-12-28 02:29

developer   ~0014580

Agreed.

zookeeper

2015-03-05 18:45

developer  

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
axis_fix.patch (1,042 bytes)   

zookeeper

2015-03-05 18:46

developer   ~0016537

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.

zookeeper

2015-03-05 22:25

developer   ~0016538

Fix committed to zookeeper@11275.

Related Changesets

fs2open: zookeeper r11275

2015-03-05 17:41

zookeeper


Ported: N/A

Details Diff
Possibly fixed Mantis 0002436: Mouse controls ignore the axis binds. Affected Issues
0002436
mod - /branches/zookeeper/code/playerman/playercontrol.cpp Diff File

Issue History

Date Modified Username Field Change
2011-05-20 01:15 iss_mneur New Issue
2012-12-26 09:09 niffiwan Note Added: 0014577
2012-12-27 12:31 The_E Note Added: 0014579
2012-12-28 02:29 iss_mneur Note Added: 0014580
2012-12-28 02:29 iss_mneur Product Version 3.6.13 => 3.7.2
2015-03-05 18:45 zookeeper File Added: axis_fix.patch
2015-03-05 18:46 zookeeper Note Added: 0016537
2015-03-05 22:25 zookeeper Changeset attached => fs2open zookeeper r11275
2015-03-05 22:25 zookeeper Note Added: 0016538
2015-03-05 22:25 zookeeper Status new => resolved
2015-03-05 22:25 zookeeper Resolution open => fixed