Install Steam
login
|
language
简体中文 (Simplified Chinese)
繁體中文 (Traditional Chinese)
日本語 (Japanese)
한국어 (Korean)
ไทย (Thai)
Български (Bulgarian)
Čeština (Czech)
Dansk (Danish)
Deutsch (German)
Español - España (Spanish - Spain)
Español - Latinoamérica (Spanish - Latin America)
Ελληνικά (Greek)
Français (French)
Italiano (Italian)
Bahasa Indonesia (Indonesian)
Magyar (Hungarian)
Nederlands (Dutch)
Norsk (Norwegian)
Polski (Polish)
Português (Portuguese - Portugal)
Português - Brasil (Portuguese - Brazil)
Română (Romanian)
Русский (Russian)
Suomi (Finnish)
Svenska (Swedish)
Türkçe (Turkish)
Tiếng Việt (Vietnamese)
Українська (Ukrainian)
Report a translation problem
Since the OP mentioned "calculating" the various angles then I guess it is rocket science.
https://ibb.co/B2vQ562
https://ibb.co/3mxwZYN
It is also possible to do things like that:
https://ibb.co/XJRKfXd
This is school level geometry/trigonometry. Turn center is located on the line that passes through middle wheels.
Minimum turn radius is determined is how far the farthest wheel can turn.
Basically, the farthest wheel, middle wheel and rotation center form a right triangle.
https://ibb.co/q5H98Q5
Let steering wheel be point A, middle wheel be point B, and rotation center be point C.
https://ibb.co/3FXKJmK
Angle ABC is right, meaning 90degrees.
Sum of all angles within triangle can only be 180 degrees, meaning BAC + ACB + ABC ==> 180 degrees, and given that ABC is 90, then BAC + ACB = 90 degrees.
angle BAC is equal to 90-steeringAngle degrees and ACB is equal to steering angle (sum of BAC and ACB is 90, BAC is 90-steering, therefore ACB = 90-(90-steering) = steering)
Given that tirangle ABC is right triangle, you can calculate distance AC by multiplying distance AB by tan(ACB) where tan(ACB) is tan(steeringAngle)
https://en.wikipedia.org/wiki/Trigonometric_functions#tan
In essence turning means locating point around which you are trying to turn, and then turning each wheel so when you look from above line passing through wheel center passes through that point.
It is possible to turn around ARBITRARY point in the world, but that requires gamedev level vector math (turn angle would be acos of dotproduct between vehicle "sideways" vector and vector pointed towards point from center of the wheel, where vector to the rotation point has to be first projected onto plane formed by vehicles "up" vector and normalzied. See: https://en.wikipedia.org/wiki/Inverse_trigonometric_functions and https://en.wikipedia.org/wiki/Dot_product ).
So instead you can loop through grid blocks, locate where each wheel is in grid coordinates, calculate their "2d" coordinates, and solve rotation angle in 2d space for predetermined turn radius, which will be easier if you never messed with vector math before.
Something like that.
The lack of diffentials could throw any angle values you work out anyway as the inside wheel wont slow to cover less distance, they will always fight eachother to some extaent and not behave like proper car wheels :)
Yup, I definitely have a habit of doing that, haha.
This is awesome and exactly what I was hoping for, thanks! I really appreciate you breaking it down to its simplest level.