2024-07-17 10:35:10 +00:00
|
|
|
#include "..\script_component.hpp"
|
2020-11-07 15:39:12 +00:00
|
|
|
/*
|
|
|
|
* Author: Vdauphin
|
2024-07-17 10:35:10 +00:00
|
|
|
* Gets surface of an item.
|
2020-11-07 15:39:12 +00:00
|
|
|
*
|
|
|
|
* Arguments:
|
|
|
|
* 0: Object <OBJECT>
|
|
|
|
*
|
|
|
|
* Return Value:
|
|
|
|
* Surface in m² <NUMBER>
|
|
|
|
*
|
|
|
|
* Example:
|
2024-07-17 10:35:10 +00:00
|
|
|
* cursorObject call ace_cargo_fnc_getSurfaceItem
|
2020-11-07 15:39:12 +00:00
|
|
|
*
|
|
|
|
* Public: No
|
|
|
|
*/
|
|
|
|
|
|
|
|
params ["_object"];
|
|
|
|
|
|
|
|
private _bbr = 0 boundingBoxReal _object;
|
|
|
|
private _p1 = _bbr select 0;
|
|
|
|
private _p2 = _bbr select 1;
|
|
|
|
private _width = abs ((_p2 select 0) - (_p1 select 0));
|
|
|
|
private _length = abs ((_p2 select 1) - (_p1 select 1));
|
|
|
|
|
|
|
|
_width * _length
|