Stormworks: Build and Rescue

Stormworks: Build and Rescue

评价数不足
Logic - World coordinates to Vehicle coordinates
   
奖励
收藏
已收藏
取消收藏
标签: v0.3.6
文件大小
发表于
更新日期
34.102 KB
2018 年 8 月 7 日 上午 11:03
2018 年 8 月 20 日 上午 2:11
3 项改动说明 ( 查看 )

订阅以下载
Logic - World coordinates to Vehicle coordinates

在 Tajin 的 1 个合集中
Logic Examples & Knowhow
54 件物品
描述
Simple logic for converting normal coordinates into vehicle coordinates.
> so basically a coordinate system that is centered and oriented to your vehicle
X+ = right
Y+ = front


By itself this doesn't do a lot but it makes working with gps coordinates and trigonometry a whole lot easier.
So instead of working with your target coordinates directly, convert them to vehicle space first and you'll need less logic for whatever you're doing with those coordinates next.


You could even use this to make a simple but effective autopilot just by feeding the X coordinates into a pid with a 0 setpoint. The pid will steer towards making X = 0, which means you're pointing right at your target and Y becomes the distance to it.


- - - - -

Update:
I've now also included the inverse equation for this. The black box calculates the object coordinates and the white box uses those values and converts them back into the original coordinates.
1 条留言
SamuelPepys 2018 年 8 月 7 日 下午 4:58 
Will test it, seems very useful!