Created
January 15, 2014 06:14
-
-
Save Mekapiku/8431647 to your computer and use it in GitHub Desktop.
JoyStickFunc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void joystick(unsigned int buttonMask, int x, int y, int z) | |
{ | |
if (x) { | |
/* 左スティックを左右に倒した際の処理 */ | |
car.driver.sw = -x*2*M_PI/360/1000; // ハンドル | |
} | |
if (y) { | |
/* 左スティックを上下に倒した際の処理 */ | |
car.deltaspeed = (-(double)y/1000); //アクセル、ブレーキ (y: 100->0.1km) | |
} | |
if (z) { | |
/* 右スティックを左右に倒した際の処理 */ | |
} | |
/*switch (buttonMask) { | |
case GLUT_JOYSTICK_BUTTON_A: | |
//ボタン 1 を押した際の処理 | |
break; | |
}*/ | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment