Fixed wiimote steering (steering was dependend on
roll, i.e. tilting the wiimote forward would affect steering), #990. git-svn-id: svn+ssh://svn.code.sf.net/p/supertuxkart/code/main/trunk@14301 178a84e3-b1eb-0310-8ba1-8eac791a3b58
This commit is contained in:
parent
effc7049a2
commit
b51f500f8f
@ -76,17 +76,19 @@ void Wiimote::resetIrrEvent()
|
||||
*/
|
||||
void Wiimote::update()
|
||||
{
|
||||
float normalized_angle = -(m_wiimote_handle->accel.y-128)
|
||||
/ UserConfigParams::m_wiimote_max;
|
||||
|
||||
#ifdef DEBUG
|
||||
if(UserConfigParams::m_wiimote_debug)
|
||||
{
|
||||
Log::verbose("wiimote", "pitch: %f yaw %f roll %f",
|
||||
m_wiimote_handle->orient.pitch,
|
||||
m_wiimote_handle->orient.yaw,
|
||||
m_wiimote_handle->orient.roll);
|
||||
Log::verbose("wiimote", "xyz %d %d %d %f",
|
||||
m_wiimote_handle->accel.x,
|
||||
m_wiimote_handle->accel.y,
|
||||
m_wiimote_handle->accel.z,
|
||||
normalized_angle);
|
||||
}
|
||||
#endif
|
||||
|
||||
float normalized_angle = -m_wiimote_handle->orient.pitch / UserConfigParams::m_wiimote_max;
|
||||
if(normalized_angle<-1.0f)
|
||||
normalized_angle = -1.0f;
|
||||
else if(normalized_angle>1.0f)
|
||||
|
Loading…
Reference in New Issue
Block a user