Auto center wheels & forces
by Ryan Ackley · in Torque Game Engine · 03/15/2003 (5:02 pm) · 3 replies
A while back there was a post with a way to force wheeled vehicles to auto center their wheels ( i suppose it works for the other types, since its in vehicle.cc ), it goes along the lines of
The wheels center themselves alright, but it seems that after making a turn, the forces from the turn cause the car to keep turning, though the wheels are pointed straight. I was thinking that updateforces() would help, but theres zero code in there. So anyone know why im still turning, even though the wheels are pointed straight? Is this just a hack on the animation? Any help is appreciated.
Ryan
// Steering
if (move != &NullMove)
{
if(move->yaw )
{
F32 y = move->yaw;
mSteering.x = mClampF(mSteering.x + y,-mDataBlock->maxSteeringAngle,
mDataBlock->maxSteeringAngle);
F32 p = move->pitch;
mSteering.y = mClampF(mSteering.y + p,-mDataBlock->maxSteeringAngle,
mDataBlock->maxSteeringAngle);
}
else
{
mSteering.x *= 0.7;
mSteering.y *= 0.7;
}
}
else
{
mSteering.x *= 0.7;
mSteering.y *= 0.7;
}The wheels center themselves alright, but it seems that after making a turn, the forces from the turn cause the car to keep turning, though the wheels are pointed straight. I was thinking that updateforces() would help, but theres zero code in there. So anyone know why im still turning, even though the wheels are pointed straight? Is this just a hack on the animation? Any help is appreciated.
Ryan
About the author
#2
mSteering.x *= 0.7;
mSteering.y *= 0.7;
put this instead
mSteering.x = 0;
mSteering.y = 0;
03/16/2003 (8:36 am)
Your last ELSEmSteering.x *= 0.7;
mSteering.y *= 0.7;
put this instead
mSteering.x = 0;
mSteering.y = 0;
Torque Owner Ryan Ackley
Ryan