ili*_*rit 5 language-agnostic algorithm
有人知道用于控制简单坦克式车辆运动的公式吗?
要"操纵"它,你需要改变施加左右"轮子"的力.例如.两个车轮上的1个单位的力使其前进.两个车轮上的-1个单位的力使其向后移动.对一个轮子施加的力比另一个轮子更大,然后转动.
您如何计算两个车轮所需的力量,以便将油箱转向一定程度的度数?
或者我是以错误的方式思考这个问题?
编辑:威廉凯勒提到我错过了坦克的速度.假设两个车轮上的1个单位的力以每秒1个单位向前移动油箱.
对于任何有兴趣的人,我只是在gamedev.net上找到了这个帖子:http://66.102.9.104/search?q = cache:wSn5t58ACJwJ:www.gamedev.net/community/forum/topic.asp%3Ftopic_id%3D407491+tank +轨道+半径+速度&HL = EN&CT = clnk和CD = 1&GL = ZA&客户=火狐-一个
另一个主题是:http://www.physicsforums.com/showthread.php? t = 220317
事实证明找到公式的关键只是知道正确的术语("滑行转向"):P
对于需要以内轮/轨道的给定速度“Si”以半径“r”转弯的滑移车辆,外轨道必须以速度“So”驱动:
So = Si * ((r+d)/r)
Run Code Online (Sandbox Code Playgroud)
细节:
在滑移转向中,转弯是通过外轮/履带比内轮/履带行驶更远的距离来执行的。
此外,额外行驶的距离与内侧履带同时完成,这意味着外侧轮/履带必须跑得更快。
由“内”轨道外接的圆周长:
c1 = 2*PI*r
'r' is radius of circle origin to track/wheel
Run Code Online (Sandbox Code Playgroud)
由“外”轨道外接的圆周长:
c2 = 2*PI*(r+d)
'r' is radius of circle origin to inner track/wheel
'd' is the distance between the Inner and Outer wheels/track.
Run Code Online (Sandbox Code Playgroud)
此外,c2 = X * c1,这表示 c2 按比例大于 c1
X = c2 / c1
X = 2*PI*(r+d) / 2*PI*r
X = (r+d)/r
Run Code Online (Sandbox Code Playgroud)
因此,对于需要在内轮/轨道的给定速度“s”下以半径“r”转弯的滑移车辆,外轨道必须以以下速度驱动:
So = Si * ((r+d)/r)
Run Code Online (Sandbox Code Playgroud)
在哪里:
'So' = Speed of outer track
'Si' = Speed of inner track
'r' = turn radius from inner track
'd' = distance between vehicle tracks.
********* <---------------- Outer Track
**** | ****
** |<--------**----------- 'd' Distance between tracks
* *******<-------*---------- Inner Track
* *** ^ *** *
* * |<-----*------*-------- 'r' Radius of Turn
* * | * *
* * O * *
* * * *
* * * *
* *** *** *
* ******* *
** **
**** ****
*********
Run Code Online (Sandbox Code Playgroud)