Skip to content

Commit

Permalink
Replace linalg and statistics utilities with CBA and BIS functions (#368
Browse files Browse the repository at this point in the history
)
  • Loading branch information
Kexanone authored Sep 21, 2018
1 parent bdc6fce commit 6448b26
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 91 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class CfgFunctions
file = "\achilles\functions_f_achilles\functions\common";

class sum;
class arrayMean;
class pushBack;
class TextToVariableName;
class HigherConfigHierarchyLevel;
Expand All @@ -29,8 +28,6 @@ class CfgFunctions
class setUnitAmmoDef;
class setVehicleAmmoDef;
class checkLineOfFire2D;
class matrixTranspose;
class vectorMap;
class dikToLetter;
class getCuratorSelected;
class deadlyExplosion;
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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];

Expand Down

0 comments on commit 6448b26

Please sign in to comment.