Files |  Tutorials |  Articles |  Links |  Home |  Team |  Forum |  Wiki |  Impressum

Aktuelle Zeit: Sa Mai 25, 2024 15:12

Foren-Übersicht » English » English Programming Forum
Unbeantwortete Themen | Aktive Themen



Ein neues Thema erstellen Auf das Thema antworten  [ 10 Beiträge ] 
Autor Nachricht
 Betreff des Beitrags: Newton - Vehicle Torque
BeitragVerfasst: Di Mär 08, 2005 09:19 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
How do u get the Torq of a tire? There is no GetTorque function/procedure designed for vehicles and the NewtonBodyGetTorque requires a Body, and i can't work out how to get the tires body....

_________________
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Di Mär 08, 2005 10:58 
Offline
DGL Member
Benutzeravatar

Registriert: Mo Sep 23, 2002 19:27
Beiträge: 5812
Programmiersprache: C++
If you apply torque on a wheel it results in an angular velocity of the wheel. So use NewtonVehicleGetTireOmega (Omega is angular velocity).

_________________
www.SaschaWillems.de | GitHub | Twitter | GPU Datenbanken (Vulkan, GL, GLES)


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Di Mär 08, 2005 12:00 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
Omega is a small value far lower than Torq.... even doing the "speed" calculation of Radius * Omega, the "Speed" is only something like 9 and the torq is 250.

I don't get how Vehicles are ment to work, if u can't work out the Torq to re-apply to the Tires when u hit the acceleration (for a gradual speed increase)

_________________
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Di Mär 08, 2005 12:25 
Offline
DGL Member
Benutzeravatar

Registriert: Mo Sep 23, 2002 19:27
Beiträge: 5812
Programmiersprache: C++
Those should help you unterstand :
http://home.planet.nl/~monstrous/tutcar.html
http://phors.locost7.info/contents.htm

_________________
www.SaschaWillems.de | GitHub | Twitter | GPU Datenbanken (Vulkan, GL, GLES)


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Di Mär 08, 2005 15:10 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
Torq applyed has something to do with the RPM ?

Only 2 calculations looked useful:

hp = torque *rpm / 5252

and

rpm = wheel rotation rate * gear ratio * differential ratio * 60 / 2 pi

With the first being pointless since Torque is a misterious value that can't(looking at ur replys its imposible to work our the current Torque) be worked out.....



Are there any Newton examples that have been made that show how to make a car go faster than a snail?

_________________
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Mär 09, 2005 12:24 
Offline
DGL Member
Benutzeravatar

Registriert: Mo Sep 23, 2002 19:27
Beiträge: 5812
Programmiersprache: C++
If you don't want to implement a gearbox, you should do this in SetTirePhysics :

Code:
  1. Omega := NewtonVehicleGetTireOmega(Vehicle, TireID);
  2. NewtonVehicleSetTireTorque(Vehicle, TireId, Torque-0.1*Omega);


I'm doing it in a current (on hold cause of the PGD-compo) gameproject which uses a vehicle that has no gearbox (I could include one, but the user has enough to do already) and I use the above part to accelerate it. It should give you some linear acceleration, as long as the wheels don't loose grip.

_________________
www.SaschaWillems.de | GitHub | Twitter | GPU Datenbanken (Vulkan, GL, GLES)


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Mi Mär 09, 2005 16:39 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
That was already in ur Vehicle demo... Tires loose grip if u use a value too high, but all values seem to be too low for it to go any decent speed.

In the end id just like a Vehicle that can react like ud expect any vehicle in a game. Gearbox or no gearbox. But i have no clue as how to work out the torque ud need to apply depending on what gear ur on.

Note: some modifications to the original, but basicaly the same
Note2: my "world" is about 5 times the size of the Vehicle Demo one (Car's size is multiplyed by 5, MultiSize = 5)
Code:
  1.  
  2. procedure TNewtonTire.SetTirePhysics(const Vehicle : PNewtonJoint; TireID : Integer);
  3. var
  4.  Accel : Single;
  5.  Omega : Single;
  6.  speed : Single;
  7. begin
  8. // Get tire's angular velocity (angular velocity = omega)
  9. Omega := NewtonVehicleGetTireOmega(Vehicle, TireID);
  10. // Add some viscuos damp to the tire torque (this prevents out of control spin)
  11. NewtonVehicleSetTireTorque(Vehicle, TireId, Torque-0.1*Omega);
  12.  
  13. speed := 1*MultiSize * Omega;
  14. //speed := NewtonVehicleGetTireLateralSpeed(Vehicle, TireID);
  15. NewtonVehicleSetTireMaxSideSleepSpeed (Vehicle, TireID, speed * 0.1);
  16. // The side slip is usually propostinal to the tire longitudilnal speed, and tire load
  17. NewtonVehicleSetTireSideSleepCoeficient (Vehicle, TireID, speed * 0.05);
  18.  
  19. // Braking
  20. if Brake > 0 then
  21.  begin
  22.  // Get acceleration that's needed to stop the wheel
  23.  Accel := NewtonVehicleTireCalculateMaxBrakeAcceleration(Vehicle, TireID);
  24.  // Brake the wheel
  25.  NewtonVehicleTireSetBrakeAcceleration(Vehicle, TireID, Accel, BreakTorq);
  26.  
  27.             // set some side slipe as funtion of the linear speed
  28.   speed := NewtonVehicleGetTireLongitudinalSpeed (Vehicle, TireID);
  29.   NewtonVehicleSetTireMaxSideSleepSpeed (Vehicle, TireID, speed * 0.1);
  30.  end;
  31. // Reset brake
  32. Brake := 0;
  33.  
  34. Self.speed := speed;
  35. // Update graphics body
  36. NewtonVehicleGetTireMatrix(Vehicle, ID, @GraphBody.Matrix[0,0]);
  37. end;
  38.  

_________________
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Do Mär 10, 2005 17:24 
Offline
DGL Member
Benutzeravatar

Registriert: Mo Sep 23, 2002 19:27
Beiträge: 5812
Programmiersprache: C++
Scaling everything up by factor 5 may not be a good way. Is there any reason yo need to do that? If not, try to scale it down. Also try to change default material parameters so that the vehicle get's more grip on the floor. Also try to give the vehicle a higher mass (and maybe also the tires). Right now it's very hard to tweak a vehicle so that it also behaves like a real vehicle (especially when the bodies are bigger and so their masses are also high), but the next newton release will change that.

_________________
www.SaschaWillems.de | GitHub | Twitter | GPU Datenbanken (Vulkan, GL, GLES)


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Do Mär 10, 2005 22:01 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
Well think of the car as the size of an ant. Cars just way too small for the level. (defaultly)

Everything, Models, Positions, Level Geometry, Etc is based on a system where 1 is the smallest value. Resizing everything, and re-computing all the offsets, etc imo is a waste of time.

Increasing Friction doesn't get much of a boost. See the DND source for the current implementation of it.

_________________
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Nach oben
 Profil  
Mit Zitat antworten  
 Betreff des Beitrags:
BeitragVerfasst: Sa Mär 12, 2005 20:45 
Offline
DGL Member
Benutzeravatar

Registriert: Mi Jul 21, 2004 22:39
Beiträge: 360
Wohnort: UK, Scotland
"but the next newton release will change that"

1.32 seems just as imposible. Increasing the mass makes the car eather stop dead and not move (even when the torq is high) or the car bounces alot (which it can do when the car hits a ramp at a decent speed).

_________________
Free Map Editor - Game Requirements - Stucuk.Net
-Stu


Nach oben
 Profil  
Mit Zitat antworten  
Beiträge der letzten Zeit anzeigen:  Sortiere nach  
Ein neues Thema erstellen Auf das Thema antworten  [ 10 Beiträge ] 
Foren-Übersicht » English » English Programming Forum


Wer ist online?

Mitglieder in diesem Forum: 0 Mitglieder und 8 Gäste


Du darfst keine neuen Themen in diesem Forum erstellen.
Du darfst keine Antworten zu Themen in diesem Forum erstellen.
Du darfst deine Beiträge in diesem Forum nicht ändern.
Du darfst deine Beiträge in diesem Forum nicht löschen.
Du darfst keine Dateianhänge in diesem Forum erstellen.

Suche nach:
Gehe zu:  
cron
  Powered by phpBB® Forum Software © phpBB Group
Deutsche Übersetzung durch phpBB.de
[ Time : 0.111s | 17 Queries | GZIP : On ]