Stormworks: Build and Rescue

Stormworks: Build and Rescue

Not enough ratings
Logic - World coordinates to Vehicle coordinates
   
Award
Favorite
Favorited
Unfavorite
File Size
Posted
Updated
34.102 KB
7 Aug, 2018 @ 11:03am
20 Aug, 2018 @ 2:11am
3 Change Notes ( view )

Subscribe to download
Logic - World coordinates to Vehicle coordinates

In 1 collection by Tajin
Logic Examples & Knowhow
54 items
Description
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 Comments
SamuelPepys 7 Aug, 2018 @ 4:58pm 
Will test it, seems very useful!