-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfn_flight.sqf
64 lines (41 loc) · 1.42 KB
/
fn_flight.sqf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//tardis flight
_pos = getPos tardis_outer;
_pos = _pos vectorAdd [0, 0, 2];
_velocity = velocity tardis_outer;
hint format ["%1", _velocity];
_dir = [0,0,0];
_up = [0,0,0];
flightCam = "camcurator" camCreate _pos;
flightCam cameraEffect ["internal", "BACK"];
flightCam camCommit 0;
flightRunning = true;
endCam = {
params ["_displayCode","_keyCode","_isShift","_isCtrl","_isAlt"];
if(_keyCode in actionKeys "ReloadMagazine") then {
flightCam cameraEffect["terminate", "back"];
camDestroy flightCam;
};
};
(findDisplay 46) displayAddEventHandler ["KeyDown", {_this spawn endCam; _flightRunning = false}];
while {flightRunning} do {
_camPosCurrent = getPosASL flightCam;
_camDirCurrent = vectorDir flightCam;
_camUpCurrent = vectorUp flightCam;
_diff = _pos vectorDistance _camPosCurrent;
_camVelocity = velocity flightCam;
_newPos = _camPosCurrent vectorAdd [2, 2, -2];
_tardisPos = getPosAsL tardis_outer;
if (_diff > 5 || _diff < -5) then {
tardis_outer setVelocityTransformation [_tardisPos, _newPos, _velocity, _camVelocity, _dir, _camDirCurrent, _up, _camUpCurrent, 0.5];
_velocity = _camVelocity;
_pos = _camPosCurrent;
_dir = _camDirCurrent;
_up = _camUpCurrent;
sleep 0.25;
} else {
tardis_outer setPosASL _newPos;
sleep 0.1;
tardis_outer setVectorDir _camDirCurrent;
tardis_outer setVectorUp _camUpCurrent;
};
};