Skip to content

Commit

Permalink
Fix spectator icons and camera jitter (#5067)
Browse files Browse the repository at this point in the history
* Use `Visual` commands for icons and external camera position
  • Loading branch information
rebelvg authored and kymckay committed Jun 3, 2017
1 parent 1b516bb commit bf4b49a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion addons/spectator/functions/fnc_handleCamera.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ if (GVAR(camMode) == 0) then {
_vector = _vector vectorAdd [0,0,_distance*sin(-_tilt)];

// Update the position of the target camera (used for smooth unit tracking)
_target camSetPos ((_unit modelToWorldVisual [0,0,0]) vectorAdd [0,0,1.5]);
_target camSetPos ((ASLToAGL getPosASLVisual _unit) vectorAdd [0,0,1.5]);
_target camCommit 0;

// Update the relative position of the unit camera
Expand Down
4 changes: 2 additions & 2 deletions addons/spectator/functions/fnc_handleIcons.sqf
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ _drawVehicles = [];
_color = GETVAR(_x,GVAR(gColor),[ARR_4(0,0,0,0)]);
_txt = groupID _x;

drawIcon3D ["\A3\ui_f\data\map\markers\nato\b_inf.paa", _color, _leader modelToWorldVisual [0,0,30], 1, 1, 0, _txt, 2, 0.02];
drawIcon3D ["\A3\ui_f\data\map\markers\nato\b_inf.paa", _color, (_leader modelToWorldVisual (_leader selectionPosition "Head")) vectorAdd [0,0,1.5], 1, 1, 0, _txt, 2, 0.02];
} else {
_drawVehicles append (units _x);
};
Expand All @@ -41,6 +41,6 @@ _drawVehicles = [];
_color = GETVAR((group _x),GVAR(gColor),[ARR_4(0,0,0,0)]);
_txt = ["", GETVAR(_x,GVAR(uName),"")] select (isPlayer _x);

drawIcon3D ["\A3\ui_f\data\map\markers\military\dot_CA.paa", _color, _x modelToWorldVisual [0,0,3], 0.7, 0.7, 0, _txt, 1, 0.02];
drawIcon3D ["a3\Ui_f\data\GUI\Rsc\RscDisplayEGSpectator\UnitIcon_ca.paa", _color, (_x modelToWorldVisual (_x selectionPosition "Head")) vectorAdd [0,0,1.5], 0.7, 0.7, 0, _txt, 1, 0.02];
false
} count (_drawVehicles arrayIntersect GVAR(unitList));

0 comments on commit bf4b49a

Please sign in to comment.