BIS fnc roundDir: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "\|game([0-9])= *([^ ]+) * +\|version([0-9])= *([^ ]+) * " to "|game$1=$2 |version$3=$4 ") |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
(10 intermediate revisions by the same user not shown) | |||
Line 3: | Line 3: | ||
|game1= tkoh | |game1= tkoh | ||
|version1= 1.00 | |version1= 1.00 | ||
|game2= arma3 | |||
|version2= 0.50 | |||
|gr1= Math | |gr1= Math | ||
Line 12: | Line 15: | ||
|p1= rawDirection: [[Number]] - direction to round | |p1= rawDirection: [[Number]] - direction to round | ||
|p2= rounding: [[Number]] - (Optional, default 90) - rounding value. With 90° possible return values are 0, 90, 180 and 270 | |p2= rounding: [[Number]] - (Optional, default 90) - rounding value. With 90° possible return values are 0, 90, 180 and 270 | ||
|r1= [[Number]] - rounded direction, depending on input ''' | |r1= [[Number]] - rounded direction, depending on input. '''Can be negative or over 360''' | ||
|x1= < | |x1= <sqf>player setDir ([getDir player, 45] call BIS_fnc_roundDir);</sqf> | ||
|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]] | |seealso= [[setDir]] [[getRelDir]] [[round]] | ||
}} | }} | ||
Latest revision as of 13:12, 13 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
- Example 1:
- Example 2:
- Example 3:
- Example 4:
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