DGL
https://delphigl.com/forum/

NewtonVehicle Demo
https://delphigl.com/forum/viewtopic.php?f=19&t=3674
Seite 1 von 1

Autor:  Stucuk [ Fr Jan 14, 2005 21:00 ]
Betreff des Beitrags:  NewtonVehicle Demo

I can't work out how to make the newton demo act more real. Aka real vehicles have faster acceleration and speed. also when u reverse you don't wait for ages until it slows down, it nearly instantly stops then reverses.

Iv looked at the C demo that comes with Newton SDK(which acts realisticaly) and can't seem to find anything in it that would make the NewtonVehicle demo act more real. Increasing traction seem to make the wheels revolve faster but they don't seem to have any grip, so thats all it seems to do. Increasing the mass makes it go slower and decreasing u get very wierd physics results.

Anyone know how to make the Vehicle in the NewtonVehicle demo go faster? (i.e so that it could jump from one ramp to another..... not drive off the end at 0.000001 mph)

- Newton Vehicle

Autor:  rswm [ Mo Jan 17, 2005 17:54 ]
Betreff des Beitrags: 

change the value of newtonupdate to a higher value .... this should always help.

Autor:  Stucuk [ Mo Jan 17, 2005 21:19 ]
Betreff des Beitrags: 

Shouldn't have to speed up the entire world just to make a car go faster......

Autor:  rswm [ Mo Jan 17, 2005 23:51 ]
Betreff des Beitrags: 

then adjust the force/torque attented to the car ...

Autor:  Stucuk [ Di Jan 18, 2005 02:29 ]
Betreff des Beitrags: 

To make the car go any distance with Torq u need it to be around 25000 and the wheels spin like mad.

the only thing that i can find that has anything to do with force is here:

Code:
  1.  
  2. procedure PhysicsApplyGravityForce(const Body : PNewtonBody); cdecl;
  3. var
  4.  mass  : Single;
  5.  Ixx   : Single;
  6.  Iyy   : Single;
  7.  Izz   : Single;
  8.  Force : TVector3f;
  9. begin
  10. NewtonBodyGetMassMatrix(Body, @mass, @Ixx, @Iyy, @Izz);
  11. Force := V3(0, Mass * -19.8, 0);
  12. NewtonBodySetForce(Body, @Force);
  13. end;
  14.  


and thats just so it has gravity.

Iv played with basicaly every value, nothing seems to give any good results.

Autor:  rswm [ Di Jan 18, 2005 10:16 ]
Betreff des Beitrags: 

now i tried it myself

if you set the torque in the procedure
Code:
  1. procedure TNewtonVehicle.ProcessInput;
  2. var
  3.  Keys : array[0..255] of Boolean;
  4.  i    : Integer;
  5. begin
  6. // Update keystates
  7. for i := 0 to High(Keys) do
  8.  Keys[i] := (Hi(GetAsyncKeyState(i)) = 128);
  9. // Check keys
  10. if Keys[vk_Left] then
  11.  Vehicle.SetSteeringAngle( 30 * PI/180);
  12. if Keys[vk_Right] then
  13.  Vehicle.SetSteeringAngle(-30 * PI/180);
  14. if Keys[vk_Up] then
  15.  Vehicle.SetTorque(5000); // THIS VALUE !!!!!!!!!!!!
  16. if Keys[vk_Down] then
  17.  Vehicle.SetTorque(-250);
  18. if Keys[vk_Space] then
  19.  Vehicle.SetBrake(1);
  20. // Reset car's steering and torque if no key is pressed
  21. if (not Keys[vk_Left]) and (not Keys[vk_Right]) then
  22.  SetSteeringAngle(0);
  23. if (not Keys[vk_Up]) and (not Keys[vk_Down]) then
  24.  SetTorque(0);
  25. end;

but dont turn it into an to high value, i tried it with 2500 and 5000. i think 10000 is also possible but 25000 ???? well this looks tooo much ....

Autor:  Stucuk [ Di Jan 18, 2005 19:18 ]
Betreff des Beitrags: 

5000 causes alot of spin, and isn't much different to 2500.

Tires never grip.

Attached is a Demo Engine im working on.(easyer to see the difference with torq's) The only way i found to increase speed (a bit) was to change the friction of the MatVehicle to 2.

Keys:
Arrow keys - Movement
Enter/Return - Flip
Space - Brake

Extract Both Zips to a directory (it came to 288kb when it was all in one... evil forum size limit). Newton dll 1.3 isn't included.

Note: the boxes at the end of one jump don't work... the collision areas for them fall through the floor taking one of the boxes with them... but not the rest...
Note2: when the wheels spin they look like there going back and forward at the same time (if u turn on the show collisions from the menu), and when there not spinning they look like there going one way.

Dateianhänge:
GlobalUnits.zip [123.99 KiB]
341-mal heruntergeladen
DND.zip [164.92 KiB]
338-mal heruntergeladen

Autor:  Sascha Willems [ Di Jan 18, 2005 19:48 ]
Betreff des Beitrags: 

Use NewtonVehicleSetTireMaxLongitudinalSlideSpeed to change the point at when the tires loose grip and do a burn-out. The fact that there is no high friction in that demo is because that value is low (or set to default) which means that the wheels start to slip at low speed and when wheels are slipping (like in a burn-out) the don't have any grip and therefore it seems like low grip.

Autor:  Stucuk [ Di Jan 18, 2005 23:39 ]
Betreff des Beitrags: 

yeh i found that in the C++ one and added it. So in theory if the torq was increased gradualy insted of being a set value, it would work properly? If so how can i get the value of the current torq(i havn't seen a function to get the current torq)?

Autor:  Sascha Willems [ Mi Jan 19, 2005 12:44 ]
Betreff des Beitrags: 

You don't need to know the torque, since there is no such property for a wheel (you put torque on a wheel which causes a force). What you need is the angular velocity also known as omega which can be retrieved by NewtonVehicleGetTireOmega.

Autor:  Stucuk [ Mi Jan 19, 2005 18:49 ]
Betreff des Beitrags: 

So to work out how much torque u need to apply to the wheel would u do

Code:
  1.  
  2. speed := 1*MultiSize * Omega;
  3.  


Where 1*MuliSize is the radius of the wheel. And then add the Speed + say 50 to the wheel as torque?

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