Wheel Control
by arda · in Torque Game Engine · 09/29/2005 (1:10 pm) · 1 replies
The wheel control is giving values between [-1, 1] and its also giving values when returning to neutral position.
I bound the xaxis to yaw2.
When I turn the wheel to the left it steers to the left, but when the wheel return to the neutral position itself, steer does not turn to neutral position.
Neither yaw2 nor yaw3 is not working as I expected.
What should I do to make it return to neutral position?
Thanks
output from yaw2
[bold]
yaw2 = -0.0390784 <-------------- turned to the left
yaw2 = -0.0937667
yaw2 = -0.16408
yaw2 = -0.218769
yaw2 = -0.289082
yaw2 = -0.343771
yaw2 = -0.289082
yaw2 = -0.218769
yaw2 = -0.16408
yaw2 = -0.0937667
yaw2 = -0.0390784
yaw2 = 0.0238193 <-------------- at neutral position
yaw2 = 0.0793622
yaw2 = 0.150805
yaw2 = 0.206348
yaw2 = 0.27776
yaw2 = 0.333333
yaw2 = 0.404746
yaw2 = 0.460319
yaw2 = 0.404746<-------------- turned to the right
yaw2 = 0.333333
yaw2 = 0.27776
yaw2 = 0.206348
yaw2 = 0.150805
yaw2 = 0.0793622
yaw2 = 0.0238193<-------------- neutral
yaw2 = -0.0390784
yaw2 = -0.0937667
yaw2 = -0.16408
yaw2 = -0.218769
yaw2 = -0.289082
yaw2 = -0.343771
yaw2 = -0.289082
yaw2 = -0.218769
yaw2 = -0.16408
yaw2 = -0.0937667
yaw2 = -0.0390784
yaw2 = -0.0937667
yaw2 = -0.16408
yaw2 = -0.218769
yaw2 = -0.289082
yaw2 = -0.343771
yaw2 = -0.414084<-------------- turned to the left
yaw2 = -0.343771
yaw2 = -0.289082
yaw2 = -0.218769
yaw2 = -0.16408
yaw2 = -0.0937667
yaw2 = -0.0390784
yaw2 = 0.0238193<-------------- neutral
yaw2 = 0.0793622
yaw2 = 0.150805
yaw2 = 0.206348
yaw2 = 0.27776
yaw2 = 0.333333
yaw2 = 0.404746
yaw2 = 0.460319
yaw2 = 0.531731
yaw2 = 0.587304
yaw2 = 0.531731
yaw2 = 0.460319
yaw2 = 0.404746<-------------- right
yaw2 = 0.333333
yaw2 = 0.27776
yaw2 = 0.206348
yaw2 = 0.150805
yaw2 = 0.0793622
yaw2 = 0.0238193<-------------- neutral
[/bold]
I bound the xaxis to yaw2.
When I turn the wheel to the left it steers to the left, but when the wheel return to the neutral position itself, steer does not turn to neutral position.
Neither yaw2 nor yaw3 is not working as I expected.
What should I do to make it return to neutral position?
Thanks
function yaw2(%val)
{
echo("yaw2 = ", %val);
//$mvYaw += %val;
$mvYaw = %val;
}function yaw3(%val)
{
echo("yaw2 = ", %val);
$mvYaw += %val;
//$mvYaw = %val;
}output from yaw2
[bold]
yaw2 = -0.0390784 <-------------- turned to the left
yaw2 = -0.0937667
yaw2 = -0.16408
yaw2 = -0.218769
yaw2 = -0.289082
yaw2 = -0.343771
yaw2 = -0.289082
yaw2 = -0.218769
yaw2 = -0.16408
yaw2 = -0.0937667
yaw2 = -0.0390784
yaw2 = 0.0238193 <-------------- at neutral position
yaw2 = 0.0793622
yaw2 = 0.150805
yaw2 = 0.206348
yaw2 = 0.27776
yaw2 = 0.333333
yaw2 = 0.404746
yaw2 = 0.460319
yaw2 = 0.404746<-------------- turned to the right
yaw2 = 0.333333
yaw2 = 0.27776
yaw2 = 0.206348
yaw2 = 0.150805
yaw2 = 0.0793622
yaw2 = 0.0238193<-------------- neutral
yaw2 = -0.0390784
yaw2 = -0.0937667
yaw2 = -0.16408
yaw2 = -0.218769
yaw2 = -0.289082
yaw2 = -0.343771
yaw2 = -0.289082
yaw2 = -0.218769
yaw2 = -0.16408
yaw2 = -0.0937667
yaw2 = -0.0390784
yaw2 = -0.0937667
yaw2 = -0.16408
yaw2 = -0.218769
yaw2 = -0.289082
yaw2 = -0.343771
yaw2 = -0.414084<-------------- turned to the left
yaw2 = -0.343771
yaw2 = -0.289082
yaw2 = -0.218769
yaw2 = -0.16408
yaw2 = -0.0937667
yaw2 = -0.0390784
yaw2 = 0.0238193<-------------- neutral
yaw2 = 0.0793622
yaw2 = 0.150805
yaw2 = 0.206348
yaw2 = 0.27776
yaw2 = 0.333333
yaw2 = 0.404746
yaw2 = 0.460319
yaw2 = 0.531731
yaw2 = 0.587304
yaw2 = 0.531731
yaw2 = 0.460319
yaw2 = 0.404746<-------------- right
yaw2 = 0.333333
yaw2 = 0.27776
yaw2 = 0.206348
yaw2 = 0.150805
yaw2 = 0.0793622
yaw2 = 0.0238193<-------------- neutral
[/bold]
About the author
Torque Owner Dane McGreevy
echo("val= ", %val);
echo("getMouseAdjustAmount(%val)= ", getMouseAdjustAmount(%val));
$mvPitch += getMouseAdjustAmount(%val);
echo("pitch= ", $mvPitch);
Output in console-->>
val= 2
getMouseAdjustAmount(%val)= 0.002
pitch= 0.004
val= 2
getMouseAdjustAmount(%val)= 0.002
pitch= 0.008
val= -1
getMouseAdjustAmount(%val)= -0.001
pitch= -0.002
val= 9
getMouseAdjustAmount(%val)= 0.009
pitch= 0.018
val= 5
getMouseAdjustAmount(%val)= 0.005
pitch= 0.01
So, Tunca, I am wondering how you managed to get the decimal returned value for val% although you was doing yaw, I think pitch and yaw run in the exact same way.
Another discovery: when mouse wheel stayed still, no val% was returned, so that both functions would not be triggered. Am I correct?