Merge branch 'ATragMX' of https://github.com/KoffeinFlummi/ACE3 into ATragMX

Conflicts:
	addons/atragmx/RscTitles.hpp
	addons/atragmx/functions/fnc_calculate_solution.sqf
	addons/atragmx/functions/fnc_calculate_target_range_assist.sqf
	addons/atragmx/functions/fnc_target_speed_assist_timer.sqf
This commit is contained in:
ulteq 2015-04-08 11:08:28 +02:00
commit 78bb9193be
4 changed files with 215 additions and 392 deletions

File diff suppressed because it is too large Load Diff

View File

@ -19,7 +19,7 @@ _bc = _this select 14;
_dragModel = _this select 15;
_atmosphereModel = _this select 16;
_storeRangeCardData = _this select 17;
private ["_bulletPos", "_bulletVelocity", "_bulletSpeed", "_bulletAccel", "_gravity", "_deltaT"];
_bulletPos = [0, 0, 0];
_bulletVelocity = [0, 0, 0];
@ -64,13 +64,12 @@ _bulletVelocity set [0, 0];
_bulletVelocity set [1, Cos(_scopeBaseAngle) * _muzzleVelocity];
_bulletVelocity set [2, Sin(_scopeBaseAngle) * _muzzleVelocity];
while {_TOF < 15 && (_bulletPos select 1) < _targetRange} do
{
while {_TOF < 15 && (_bulletPos select 1) < _targetRange} do {
_bulletSpeed = vectorMagnitude _bulletVelocity;
_trueVelocity = _bulletVelocity vectorDiff _wind;
_trueSpeed = vectorMagnitude _trueVelocity;
if (EGVAR(advanced_ballistics,AdvancedBallistics)) then {
if (EGVAR(advanced_ballistics,AdvancedAirDragEnabled)) then {
private ["_drag"];
@ -80,14 +79,14 @@ while {_TOF < 15 && (_bulletPos select 1) < _targetRange} do
} else {
_bulletAccel = _trueVelocity vectorMultiply (_trueSpeed * _airFriction);
};
_bulletAccel = _bulletAccel vectorAdd _gravity;
_bulletVelocity = _bulletVelocity vectorAdd (_bulletAccel vectorMultiply _deltaT);
_bulletPos = _bulletPos vectorAdd (_bulletVelocity vectorMultiply _deltaT);
_TOF = _TOF + _deltaT;
if (_storeRangeCardData) then {
_range = GVAR(rangeCardStartRange) + _n * GVAR(rangeCardIncrement);
if ((_bulletPos select 1) * _rangeFactor >= _range && _range <= GVAR(rangeCardEndRange)) then {
@ -100,7 +99,7 @@ while {_TOF < 15 && (_bulletPos select 1) < _targetRange} do
};
_kineticEnergy = 0.5 * (_bulletMass / 1000 * (_bulletSpeed ^ 2));
_kineticEnergy = _kineticEnergy * 0.737562149;
GVAR(rangeCardData) set [_n, [_range, _elevation * 60, _windage * 60, _lead, _TOF, _bulletSpeed, _kineticEnergy]];
_n = _n + 1;
};

View File

@ -4,102 +4,79 @@ private ["_targetSize", "_imageSize", "_angle", "_estRange"];
_angle = parseNumber(ctrlText 7012);
_targetSize = parseNumber(ctrlText 7010);
if (GVAR(rangeAssistUseTargetHeight)) then
{
if (GVAR(rangeAssistUseTargetHeight)) then {
_targetSize = _targetSize * cos(_angle);
};
switch (GVAR(rangeAssistTargetSizeUnit)) do
{
case 0:
{
switch (GVAR(rangeAssistTargetSizeUnit)) do {
case 0: {
_targetSize = _targetSize * 0.0254;
};
case 1:
{
case 1: {
_targetSize = _targetSize * 0.3048;
};
case 2:
{
case 2: {
_targetSize = _targetSize * 0.01;
};
};
_imageSize = parseNumber(ctrlText 7011);
switch (GVAR(rangeAssistImageSizeUnit)) do
{
case 0:
{
switch (GVAR(rangeAssistImageSizeUnit)) do {
case 0: {
_imageSize = _imageSize / 6400 * 360;
};
case 1:
{
case 1: {
_imageSize = _imageSize / 60;
};
case 2:
{
case 2: {
_imageSize = _imageSize / 60 / 1.047;
};
};
_estRange = parseNumber(ctrlText 7013);
if (GVAR(currentUnit) != 2) then
{
if (GVAR(currentUnit) != 2) then {
_estRange = _estRange / 1.0936133;
};
switch (_this) do
{
case 0:
{
switch (_this) do {
case 0: {
_targetSize = tan(_imageSize) * _estRange;
if (GVAR(rangeAssistUseTargetHeight)) then
{
if (GVAR(rangeAssistUseTargetHeight)) then {
_targetSize = _targetSize / cos(_angle);
};
switch (GVAR(rangeAssistTargetSizeUnit)) do
{
case 0:
{
switch (GVAR(rangeAssistTargetSizeUnit)) do {
case 0: {
_targetSize = _targetSize / 0.0254;
};
case 1:
{
case 1: {
_targetSize = _targetSize / 0.3048;
};
case 2:
{
case 2: {
_targetSize = _targetSize / 0.01;
};
};
ctrlSetText [7010, Str(Round(_targetSize * 100) / 100)];
};
case 1:
{
case 1: {
_imageSize = atan(_targetSize / _estRange);
switch (GVAR(rangeAssistImageSizeUnit)) do
{
case 0:
{
switch (GVAR(rangeAssistImageSizeUnit)) do {
case 0: {
_imageSize = _imageSize * 6400 / 360;
};
case 1:
{
case 1: {
_imageSize = _imageSize * 60;
};
case 2:
{
case 2: {
_imageSize = _imageSize * 60 * 1.047;
};
};
ctrlSetText [7011, Str(Round(_imageSize * 100) / 100)];
};
case 2:
{
case 2: {
_estRange = _targetSize / tan(_imageSize);
ctrlSetText [7013, Str(Round(_estRange))];
};
};

View File

@ -2,29 +2,27 @@
#define _dsp (uiNamespace getVariable "ATragMX_Display")
if !(ctrlVisible 9000) then
{
if !(ctrlVisible 9000) then {
private ["_startTime"];
false execVM QUOTE(PATHTOF(functions\fnc_show_target_speed_assist.sqf));
true execVM QUOTE(PATHTOF(functions\fnc_show_target_speed_assist_timer.sqf));
ctrlSetFocus (_dsp displayCtrl 9002);
_startTime = time;
while {GVAR(speedAssistTimer)} do
{
while {GVAR(speedAssistTimer)} do {
sleep 0.1;
ctrlSetText [9001, Str(Round((time - _startTime) * 10) / 10)];
};
GVAR(speedAssistTimer) = true;
ctrlSetText [8006, Str(Round((time - _startTime) * 10) / 10)];
[] call FUNC(calculate_target_speed_assist);
false execVM QUOTE(PATHTOF(functions\fnc_show_target_speed_assist_timer.sqf));
true execVM QUOTE(PATHTOF(functions\fnc_show_target_speed_assist.sqf));
};