BIS fnc roundDir: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "<code>([^<]*)\{\{cc\|([^{}]+)\}\} *<\/code>" to "<code>$1// $2</code>") |
Lou Montana (talk | contribs) m (Text replacement - "<code> *([^<|{]*) *<\/code>" to "<sqf>$1</sqf>") |
||
Line 21: | Line 21: | ||
|x1= <code>[[player]] [[setDir]] (<nowiki>[</nowiki>[[getDir]] [[player]], 45] [[call]] [[BIS_fnc_roundDir]]);</code> | |x1= <code>[[player]] [[setDir]] (<nowiki>[</nowiki>[[getDir]] [[player]], 45] [[call]] [[BIS_fnc_roundDir]]);</code> | ||
|x2= < | |x2= <sqf>[204.2, 10] call BIS_fnc_roundDir; // will return 200</sqf> | ||
|x3= < | |x3= <sqf>[271, 180] call BIS_fnc_roundDir; // will return 360</sqf> | ||
|x4= < | |x4= <sqf>70 call BIS_fnc_roundDir; // will return 90</sqf> | ||
|seealso= [[setDir]] [[getRelDir]] [[round]] | |seealso= [[setDir]] [[getRelDir]] [[round]] | ||
}} | }} |
Revision as of 23:44, 12 July 2022
Description
- Description:
- Round direction to nearest set rounding; used for determining cardinal direction.
- Execution:
- call
- Groups:
- Math
Syntax
- Syntax:
- [rawDirection, rounding] call BIS_fnc_roundDir
- Parameters:
- rawDirection: Number - direction to round
- rounding: Number - (Optional, default 90) - rounding value. With 90° possible return values are 0, 90, 180 and 270.
- Return Value:
- Number - rounded direction, depending on input can be negative or over 360
Examples
Additional Information
Notes
-
Report bugs on the Feedback Tracker and/or discuss them on the Arma Discord or on the Forums.
Only post proven facts here! Add Note