|
0 registered members (),
18,435
guests, and 5
spiders. |
Key:
Admin,
Global Mod,
Mod
|
|
|
Re: A6 car question
[Re: Marco_Grubert]
#48836
07/26/05 02:34
07/26/05 02:34
|
Joined: Sep 2004
Posts: 260 UB,Mongolia
Olzii
OP
Member
|
OP
Member
Joined: Sep 2004
Posts: 260
UB,Mongolia
|
Thanks, Marco
I have another question. Sorry to trouble you.
1. Please explain me this line : if(abs(angRL)>abs(angRR)) {angSpeed=-angRL;} else {angSpeed=angRR;}
In my multiplayer car, if i do this line, my car is not going faster and braking.
And i changed it to this if (abs(angRL)>abs(angRR)) { angSpeed=angRL;} else {angSpeed=angRR;} and it is working but key_down is acting same as key_brake.
Why did you put sign(-) before angspeed of rear left wheel ?
2. Please tell me tips about making car's handbraking ? If you make handbraking when car speed is very high, car will stop changing orientation /I don't know how to call it/. In your tutorial car doesnot change it's orientation, it will just stop.
The Empire of the Mongols comprised the largest continuous land empire ever, reaching from Korea to Poland
|
|
|
Re: A6 car question
[Re: Olzii]
#48837
07/26/05 02:43
07/26/05 02:43
|
Joined: Sep 2004
Posts: 260 UB,Mongolia
Olzii
OP
Member
|
OP
Member
Joined: Sep 2004
Posts: 260
UB,Mongolia
|
Here is my multiplayer A6 car : exe
The Empire of the Mongols comprised the largest continuous land empire ever, reaching from Korea to Poland
|
|
|
Re: A6 car question
[Re: Olzii]
#48838
07/26/05 23:21
07/26/05 23:21
|
Joined: Sep 2003
Posts: 3,236 San Diego, CA
Marco_Grubert
Expert
|
Expert
Joined: Sep 2003
Posts: 3,236
San Diego, CA
|
Quote:
1. Please explain me this line : if(abs(angRL)>abs(angRR)) {angSpeed=-angRL;} else {angSpeed=angRR;}
This is a hack that's not quite as good as it could be. What that function does is it tries to find the cars current speed (angular speed of its rear wheels). Since one of the wheels might be stuck in a corner with the other one spinning the if clause picks the larger velocity of the two wheels. For the sample car the wheels were mounted with the hubcaps facing outwards. This means that the right rear wheel will spin forward, but the left wheel is 180 degrees rotated with respect to the left wheel. Because of that rotation it returns it's forward speed as a negative value. That's why the angular velocity of the rear left wheel (angRL) is negated. If your wheels are symmetrical you can just duplicate them without rotation and remove the minus sign in that line above.
Quote:
If you make handbraking when car speed is very high, car will stop changing orientation /I don't know how to call it/. In your tutorial car doesnot change it's orientation, it will just stop.
I think you are saying that your car spins to the left or right when you pull the handbrake. This comes from tiny differences in friction between the wheels. It can be solved by applying less braking torque or by applying the torque smoothly over time. If you look at the top of the file you should see the constant definition for braking torque which is about 50% of maximum torque delivered by the drivetrain if I remember correctly. To summarize: make your brakes less effective so that the wheels won't lock and the car won't spin.
|
|
|
Re: A6 car question
[Re: Marco_Grubert]
#48839
07/27/05 01:05
07/27/05 01:05
|
Joined: Sep 2004
Posts: 260 UB,Mongolia
Olzii
OP
Member
|
OP
Member
Joined: Sep 2004
Posts: 260
UB,Mongolia
|
I want that my car must spin to left or right when car has high speed and i push handbrake. In other games like GTA and NFS, it does so.
I decreased brake torque down, it has same effect. Brake torque was affecting only in speed, but car did not spin.
The Empire of the Mongols comprised the largest continuous land empire ever, reaching from Korea to Poland
|
|
|
|
|
|