diff --git a/@AresModAchillesExpansion/addons/functions_f_achilles/cfgFunctions.hpp b/@AresModAchillesExpansion/addons/functions_f_achilles/cfgFunctions.hpp index cd2efb12..7b1cc7da 100644 --- a/@AresModAchillesExpansion/addons/functions_f_achilles/cfgFunctions.hpp +++ b/@AresModAchillesExpansion/addons/functions_f_achilles/cfgFunctions.hpp @@ -17,7 +17,6 @@ class CfgFunctions file = "\achilles\functions_f_achilles\functions\common"; class sum; - class arrayMean; class pushBack; class TextToVariableName; class HigherConfigHierarchyLevel; @@ -29,8 +28,6 @@ class CfgFunctions class setUnitAmmoDef; class setVehicleAmmoDef; class checkLineOfFire2D; - class matrixTranspose; - class vectorMap; class dikToLetter; class getCuratorSelected; class deadlyExplosion; diff --git a/@AresModAchillesExpansion/addons/functions_f_achilles/functions/common/fn_arrayMean.sqf b/@AresModAchillesExpansion/addons/functions_f_achilles/functions/common/fn_arrayMean.sqf deleted file mode 100644 index 118c8f55..00000000 --- a/@AresModAchillesExpansion/addons/functions_f_achilles/functions/common/fn_arrayMean.sqf +++ /dev/null @@ -1,24 +0,0 @@ -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// AUTHOR: Kex -// DATE: 6/19/16 -// VERSION: 2.0 -// FILE: functions_f_achilles\functions\common\functions\fn_arrayMean.sqf -// DESCRIPTION: Determines the mean of an array -// -// ARGUMENTS: -// _this: ARRAY - array of numbers -// -// RETURNS: -// _this: SCALAR - mean value -// -// Example: -// [1,2,3] call Achilles_fnc_arrayMean; //returns 3 -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -private _n_items = count _this; -if (_n_items == 0) exitWith {0}; -private _sum = 0; -{ - _sum = _sum + _x; -} forEach _this; -_sum / _n_items diff --git a/@AresModAchillesExpansion/addons/functions_f_achilles/functions/common/fn_getUnitAmmoDef.sqf b/@AresModAchillesExpansion/addons/functions_f_achilles/functions/common/fn_getUnitAmmoDef.sqf index 5574efcf..87a0cd73 100644 --- a/@AresModAchillesExpansion/addons/functions_f_achilles/functions/common/fn_getUnitAmmoDef.sqf +++ b/@AresModAchillesExpansion/addons/functions_f_achilles/functions/common/fn_getUnitAmmoDef.sqf @@ -61,6 +61,6 @@ private _percentages = []; // return the mean of all percentages if (!(_percentages isEqualTo [])) exitWith { - _percentages call Achilles_fnc_arrayMean + _percentages call BIS_fnc_arithmeticMean }; 0 diff --git a/@AresModAchillesExpansion/addons/functions_f_achilles/functions/common/fn_getVehicleAmmoDef.sqf b/@AresModAchillesExpansion/addons/functions_f_achilles/functions/common/fn_getVehicleAmmoDef.sqf index ab0b9283..39e448a2 100644 --- a/@AresModAchillesExpansion/addons/functions_f_achilles/functions/common/fn_getVehicleAmmoDef.sqf +++ b/@AresModAchillesExpansion/addons/functions_f_achilles/functions/common/fn_getVehicleAmmoDef.sqf @@ -53,7 +53,7 @@ private _AllTurretAmmoPercentages = []; if (!(_TurretAmmoPercentages isEqualTo [])) then { - _AllTurretAmmoPercentages pushBack (_TurretAmmoPercentages call Achilles_fnc_arrayMean); + _AllTurretAmmoPercentages pushBack (_TurretAmmoPercentages call BIS_fnc_arithmeticMean); }; } forEach _turretsCfg; @@ -76,13 +76,13 @@ if (isClass (configFile >> "cfgVehicles" >> _vehicleType >> "Components" >> "Tra }; }; } forEach (getPylonMagazines _vehicle); - _AllTurretAmmoPercentages pushBack (_TurretAmmoPercentages call Achilles_fnc_arrayMean); + _AllTurretAmmoPercentages pushBack (_TurretAmmoPercentages call BIS_fnc_arithmeticMean); }; // return the overall mean of all percentages if (!(_AllTurretAmmoPercentages isEqualTo [])) exitWith { - _AllTurretAmmoPercentages call Achilles_fnc_arrayMean + _AllTurretAmmoPercentages call BIS_fnc_arithmeticMean }; 0 diff --git a/@AresModAchillesExpansion/addons/functions_f_achilles/functions/common/fn_matrixTranspose.sqf b/@AresModAchillesExpansion/addons/functions_f_achilles/functions/common/fn_matrixTranspose.sqf deleted file mode 100644 index 43246388..00000000 --- a/@AresModAchillesExpansion/addons/functions_f_achilles/functions/common/fn_matrixTranspose.sqf +++ /dev/null @@ -1,33 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// AUTHOR: Kyle Kotowick -// DATE: 11/20/16 -// VERSION: 1.0 -// FILE: Achilles\functions_f_achilles\common\fn_matrixTranspose.sqf -// DESCRIPTION: Transposes given matrix -// -// ARGUMENTS: -// _this select 0: matrix - input matrix -// -// RETURNS: -// _this: matrix - transposed matrix -// -// Example: -// [_matrix] call Achilles_fnc_matrixTranspose; -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -private _matrix = param [0,[],[[]]]; - -private _m = count _matrix; -private _n = count (_matrix select 0); - -private _outputMatrix = []; - -for "_j" from 0 to (_n - 1) do { - private _tmp_row = []; - for "_i" from 0 to (_m - 1) do { - _tmp_row pushBack ((_matrix select _i) select _j); - }; - _outputMatrix pushBack _tmp_row; -}; - -_outputMatrix; \ No newline at end of file diff --git a/@AresModAchillesExpansion/addons/functions_f_achilles/functions/common/fn_vectorMap.sqf b/@AresModAchillesExpansion/addons/functions_f_achilles/functions/common/fn_vectorMap.sqf deleted file mode 100644 index e19d227c..00000000 --- a/@AresModAchillesExpansion/addons/functions_f_achilles/functions/common/fn_vectorMap.sqf +++ /dev/null @@ -1,23 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// -// AUTHOR: Kex -// DATE: 11/20/16 -// VERSION: 1.0 -// FILE: Achilles\functions_f_achilles\common\fn_vectorMap.sqf -// DESCRIPTION: Maps the transposed row vector with given transformation matrix -// -// ARGUMENTS: -// _this select 0: matrix - transformation matrix -// _this select 1: vector - row vector -// -// RETURNS: -// _this: vector - row vector -// -// Example: -// [_matrix,_vector] call Achilles_fn_vectorMap; -//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// - -params[["_matrix", [], [[]]], ["_vector", [], [[]]]]; - -if (count _matrix != count _vector) exitWith {diag_log "Error: matrix multiplication: incompatible dimensions!"}; - -_matrix apply {_x vectorDotProduct _vector} diff --git a/@AresModAchillesExpansion/addons/functions_f_achilles/functions/features/fn_groupObjects.sqf b/@AresModAchillesExpansion/addons/functions_f_achilles/functions/features/fn_groupObjects.sqf index fb60b074..260174cb 100644 --- a/@AresModAchillesExpansion/addons/functions_f_achilles/functions/features/fn_groupObjects.sqf +++ b/@AresModAchillesExpansion/addons/functions_f_achilles/functions/features/fn_groupObjects.sqf @@ -42,7 +42,7 @@ private _group_attributes = []; private _vector_center_object = _object_pos vectorDiff _center_pos; private _attributes = [_vector_center_object, vectorDir _object, vectorUp _object] apply { - private _return = [_standard_to_internal, _x] call Achilles_fnc_vectorMap; + private _return = [_standard_to_internal, _x] call CBA_fnc_vectMap3D; _return; }; _group_attributes pushBack ([_object] + _attributes); diff --git a/@AresModAchillesExpansion/addons/ui_f/functions/keyEvents/fn_HandleCuratorObjectEdited.sqf b/@AresModAchillesExpansion/addons/ui_f/functions/keyEvents/fn_HandleCuratorObjectEdited.sqf index c2127510..a83edd7a 100644 --- a/@AresModAchillesExpansion/addons/ui_f/functions/keyEvents/fn_HandleCuratorObjectEdited.sqf +++ b/@AresModAchillesExpansion/addons/ui_f/functions/keyEvents/fn_HandleCuratorObjectEdited.sqf @@ -47,17 +47,17 @@ switch (true) do // define transformation matrix private _standard_to_internal = [_vector_dir, _vector_up, _vector_perpendicular]; - private _internal_to_standard = [_standard_to_internal] call Achilles_fnc_matrixTranspose; + private _internal_to_standard = [_standard_to_internal] call CBA_fnc_matrixTranspose; { _x params ["_object"]; // reposition - private _vector_center_object = [_internal_to_standard, _x select 1] call Achilles_fnc_vectorMap; + private _vector_center_object = [_internal_to_standard, _x select 1] call CBA_fnc_vectMap3D; _object setPosWorld (_vector_center_object vectorAdd _center_pos); // reorientation - private _vectors_dir_up = (_x select [2,2]) apply { [_internal_to_standard, _x] call Achilles_fnc_vectorMap; }; + private _vectors_dir_up = (_x select [2,2]) apply { [_internal_to_standard, _x] call CBA_fnc_vectMap3D; }; [_object ,_vectors_dir_up] remoteExec ["setVectorDirAndUp",0,_object];