HuntIR parachute falling speed experiment

This commit is contained in:
ulteq 2015-06-11 21:50:43 +02:00
parent d8877d0dbd
commit eff31db128
2 changed files with 10 additions and 6 deletions

View File

@ -125,7 +125,7 @@ GVAR(no_cams) sort true;
};
};
private ["_cam_coord_y", "_cam_coord_x", "_speed", "_cam_time", "_cam_pos"];
private ["_cam_coord_y", "_cam_coord_x", "_cam_time", "_cam_pos"];
GVAR(logic) setPosATL (GVAR(pos) vectorAdd [0, 0, -5]);
GVAR(logic) setDir GVAR(ROTATE);
@ -138,8 +138,7 @@ GVAR(no_cams) sort true;
ctrlSetText [1, format["%1 m", round(GVAR(pos) select 2)]];
ctrlSetText [2, format["%1", GVAR(cur_cam) + 1]];
_speed = 1 max abs((velocity GVAR(huntIR)) select 2);
_cam_time = ((GVAR(pos) select 2) - 20) / _speed;
_cam_time = (GVAR(pos) select 2) - 20;
ctrlSetText [3, format["%1 s", round(_cam_time)]];
_cam_pos = getPosVisual GVAR(huntIR);
_cam_pos = format ["X = %1, Y = %2", round (_cam_pos select 0), round (_cam_pos select 1)];

View File

@ -33,15 +33,20 @@ if (_ammo != "F_HuntIR") exitWith {};
_huntir setPosATL _position;
[{
EXPLODE_1_PVT(_this select 0,_huntir);
private ["_deltaT"];
if (isNull _huntir) exitWith {
[_this select 1] call CBA_fnc_removePerFrameHandler;
};
private ["_deltaT", "_velocity"];
_velocity = velocity _huntir;
if (damage _huntir > 0) then {
_deltaT = ACE_time - (_huntir getVariable [QGVAR(lastTime), ACE_time]);
_huntir setVelocity (velocity _huntir vectorAdd [0, 0, -9.8066 * (damage _huntir) * _deltaT]);
_velocity = _velocity vectorAdd [0, 0, -9.8066 * (damage _huntir) * _deltaT];
_huntir setVariable [QGVAR(lastTime), ACE_time];
} else {
_velocity set [2, -1];
};
_huntir setVelocity _velocity;
_huntir setVectorUp [0, 0, 1];
}, 0.1, [_huntir]] call CBA_fnc_addPerFrameHandler;
}, [getPosATL _projectile vectorAdd [0, 0, 400]], 5, 0] call EFUNC(common,waitAndExecute);
}, [getPosATL _projectile vectorAdd [0, 0, 50]], 2, 0] call EFUNC(common,waitAndExecute);
}, [_projectile], 5, 0] call EFUNC(common,waitAndExecute);