2015-01-11 16:42:31 +00:00
|
|
|
/*
|
2015-03-24 04:18:00 +00:00
|
|
|
* Author: esteldunedain
|
2015-01-11 16:42:31 +00:00
|
|
|
*
|
|
|
|
* Updates the line marker position and scale
|
|
|
|
*
|
|
|
|
* Argument:
|
|
|
|
* 0: Marker Name (string)
|
|
|
|
* 1: Marker start pos (array)
|
|
|
|
* 2: Marker end pos (array)
|
|
|
|
* 3: Color index (Number)
|
|
|
|
*
|
|
|
|
* Return value:
|
|
|
|
* Return
|
|
|
|
*/
|
|
|
|
|
2015-01-15 21:50:48 +00:00
|
|
|
#include "script_component.hpp"
|
|
|
|
|
2015-01-11 16:42:31 +00:00
|
|
|
_name = _this select 0;
|
|
|
|
_startPos = _this select 1;
|
|
|
|
_difPos = (_this select 2) vectorDiff _startPos ;
|
|
|
|
_color = _this select 3;
|
2015-03-24 04:18:00 +00:00
|
|
|
|
2015-01-11 16:42:31 +00:00
|
|
|
_name setMarkerShapeLocal "RECTANGLE";
|
|
|
|
_name setMarkerAlphaLocal 1;
|
2015-01-15 21:50:48 +00:00
|
|
|
_name setMarkerColorLocal GVAR(drawing_drawColor);
|
2015-01-11 16:42:31 +00:00
|
|
|
_name setMarkerPosLocal (_startPos vectorAdd (_difPos vectorMultiply 0.5));
|
|
|
|
_mag = vectorMagnitude _difPos;
|
|
|
|
if (_mag > 0) then {
|
|
|
|
_name setMarkerSizeLocal [5, _mag / 2];
|
|
|
|
_name setMarkerDirLocal (180 + (_difPos select 0) atan2 (_difPos select 1) mod 360);
|
|
|
|
} else {
|
|
|
|
_name setMarkerSizeLocal [5, 5];
|
|
|
|
_name setMarkerDirLocal 0;
|
|
|
|
};
|