Joysticks & Racing example
by Paul Griffiths · in Torque Game Engine · 06/11/2006 (9:10 pm) · 2 replies
Anyone know how to add joysticks in to Racing Example?
Ive changed the following in prefs.cs to:
and in defult.bind.cs i added:
i added this to init.cs:
Im using 1.4 on windows, is there anything else i have to do?
Ive changed the following in prefs.cs to:
$pref::Input::JoystickEnabled = "1"; $pref::Input::Sensitivity = 1; $pref::Input::DeadZone = 0;
and in defult.bind.cs i added:
function joyyaw(%val){
if ($pref::Input::Deadzone < %val | - $pref::Input::Deadzone > %val) {
$mvYaw = %val * $pref::Input::Sensitivity;
}
else
{
$mvYaw = 0;
}
}
function joypitch(%val){
if ($pref::Input::Deadzone < %val | - $pref::Input::Deadzone > %val) {
if($pref::Input::InvertMouse) {
$mvPitch = (- %val) * $pref::Input::Sensitivity;
}
else
{
$mvPitch = %val * $pref::Input::Sensitivity;
}
}
else
{
$mvPitch = 0;
}
}
moveMap.bind(joystick0, "zaxis", joyyaw);
moveMap.bind(joystick0, "rzaxis", joypitch);i added this to init.cs:
$enableDirectInput = "1"; activateDirectInput(); enableJoystick();
Im using 1.4 on windows, is there anything else i have to do?
#2
06/21/2006 (5:26 pm)
Thanks joey for your thread, unfortunatly the car physics isnt all that good, so will not be continuing with a car project. Thanks anyways.
Torque Owner Joey Skinner