mirror of
https://github.com/valmojr/armatak.git
synced 2026-06-13 18:03:30 +00:00
added VR map support
This commit is contained in:
@@ -33,6 +33,9 @@ class CfgFunctions {
|
|||||||
class convert_to_stratis {
|
class convert_to_stratis {
|
||||||
file = "\armatak\armatak\armatak_main\functions\map\fn_convert_to_stratis.sqf";
|
file = "\armatak\armatak\armatak_main\functions\map\fn_convert_to_stratis.sqf";
|
||||||
};
|
};
|
||||||
|
class convert_to_vr {
|
||||||
|
file = "\armatak\armatak\armatak_main\functions\map\fn_convert_to_vr.sqf";
|
||||||
|
};
|
||||||
|
|
||||||
class postMarker {
|
class postMarker {
|
||||||
file = "\armatak\armatak\armatak_main\functions\api\fn_postMarker.sqf";
|
file = "\armatak\armatak\armatak_main\functions\api\fn_postMarker.sqf";
|
||||||
|
|||||||
@@ -11,6 +11,9 @@ switch (worldName) do {
|
|||||||
case "Stratis": {
|
case "Stratis": {
|
||||||
_realLocation = _position call armatak_fnc_convert_to_stratis;
|
_realLocation = _position call armatak_fnc_convert_to_stratis;
|
||||||
};
|
};
|
||||||
|
case "VR": {
|
||||||
|
_realLocation = _position call armatak_fnc_convert_to_vr;
|
||||||
|
};
|
||||||
default {};
|
default {};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
23
addons/main/functions/map/fn_convert_to_vr.sqf
Normal file
23
addons/main/functions/map/fn_convert_to_vr.sqf
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
params["_latitude", "_longitude", "_altitude"];
|
||||||
|
|
||||||
|
_playerPosition = [_latitude, _longitude, _altitude];
|
||||||
|
|
||||||
|
_playerLatitude = _playerPosition select 0;
|
||||||
|
_playerLongitude = _playerPosition select 1;
|
||||||
|
|
||||||
|
_playerMaxLongitude = 8192;
|
||||||
|
_playerMaxLatitude = 8192;
|
||||||
|
|
||||||
|
_MapMaxLatitude = 37.266306;
|
||||||
|
_MapMinLatitude = 37.189233;
|
||||||
|
|
||||||
|
_MapMaxLongitude = -115.771889;
|
||||||
|
_MapMinLongitude = -115.863786;
|
||||||
|
|
||||||
|
_LongitudeDifference = _MapMaxLongitude - _MapMinLongitude;
|
||||||
|
_LatitudeDifference = _MapMaxLatitude - _MapMinLatitude;
|
||||||
|
|
||||||
|
_RealLongitude = (_playerLongitude / _playerMaxLongitude) * _LongitudeDifference + _MapMinLongitude;
|
||||||
|
_RealLatitude = (_playerLatitude / _playerMaxLatitude) * _LatitudeDifference + _MapMinLatitude;
|
||||||
|
|
||||||
|
[_RealLongitude, _RealLatitude, _playerPosition select 2]
|
||||||
Reference in New Issue
Block a user