DGL
https://delphigl.com/forum/

Newton - Vehicle Torque
https://delphigl.com/forum/viewtopic.php?f=19&t=3884
Seite 1 von 1

Autor:  Stucuk [ Di Mär 08, 2005 09:19 ]
Betreff des Beitrags:  Newton - Vehicle Torque

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....

Autor:  Sascha Willems [ Di Mär 08, 2005 10:58 ]
Betreff des Beitrags: 

If you apply torque on a wheel it results in an angular velocity of the wheel. So use NewtonVehicleGetTireOmega (Omega is angular velocity).

Autor:  Stucuk [ Di Mär 08, 2005 12:00 ]
Betreff des Beitrags: 

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)

Autor:  Sascha Willems [ Di Mär 08, 2005 12:25 ]
Betreff des Beitrags: 

Those should help you unterstand :
http://home.planet.nl/~monstrous/tutcar.html
http://phors.locost7.info/contents.htm

Autor:  Stucuk [ Di Mär 08, 2005 15:10 ]
Betreff des Beitrags: 

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?

Autor:  Sascha Willems [ Mi Mär 09, 2005 12:24 ]
Betreff des Beitrags: 

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.

Autor:  Stucuk [ Mi Mär 09, 2005 16:39 ]
Betreff des Beitrags: 

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.  

Autor:  Sascha Willems [ Do Mär 10, 2005 17:24 ]
Betreff des Beitrags: 

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.

Autor:  Stucuk [ Do Mär 10, 2005 22:01 ]
Betreff des Beitrags: 

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.

Autor:  Stucuk [ Sa Mär 12, 2005 20:45 ]
Betreff des Beitrags: 

"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).

Seite 1 von 1 Alle Zeiten sind UTC + 1 Stunde
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/