Skip to content

script map make local

Tomáš Malý edited this page Jan 10, 2019 · 5 revisions

Map Make Local

Attach this script to the object with Map script attached.

When the map configuration is downloaded, this script will move and rotate the map such that the configured latitude-longitude position is at (0,0,0) in Unity world coordinates. It will also be aligned such that the gravity direction in unity world (0,-1,0) is the same as on the map. And Unity forward (0, 0, 1) will point to North.

script-map-make-local.png Green are VTS coordinates, blue are Unity coordinates.

In the surrounding area, the floating point precision is also sufficient for Camera Objects and Collider Probe scripts to work properly.

More technically, this script transforms the map such that a tangential space of the ellipsoidal surface of the planet at the specified coordinates is aligned with the usual Unity world space.