BIS fnc smoothStep: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " <h3 style="display:none">Notes</h3> <dl class="command_description"> <!-- Note Section BEGIN --> <!-- Note Section END --> </dl> " to "") |
Lou Montana (talk | contribs) m (Text replacement - " *\| *([Cc]omments|COMMENTS|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments \("local" or "global"\)|Multiplayer Effects \("local" or "global"\)|Multiplayer Execution \("server" o...) |
||
Line 1: | Line 1: | ||
{{Function | {{Function | ||
| arma3 | | arma3 | ||
|1.76 | |1.76 | ||
|gr1 = Interpolation | |gr1 = Interpolation | ||
| Interpolates between 0 and 1 with smoothing at the limits. Formula is {{Inline code|n² × (3 - 2n)}}. | | Interpolates between 0 and 1 with smoothing at the limits. Formula is {{Inline code|n² × (3 - 2n)}}. | ||
| number call [[BIS_fnc_smoothStep]] | | number call [[BIS_fnc_smoothStep]] | ||
|p1= number: [[Number]] - a number in range 0..1. A value not in range will be [[floor|floored]] to 0 or [[ceil|ceiled]] to 1 | |p1= number: [[Number]] - a number in range 0..1. A value not in range will be [[floor|floored]] to 0 or [[ceil|ceiled]] to 1 | ||
| [[Number]] - interpolation result | | [[Number]] - interpolation result | ||
|x1= <code>_smoothedStep = 0.75 [[call]] [[BIS_fnc_smoothStep]];</code> | |x1= <code>_smoothedStep = 0.75 [[call]] [[BIS_fnc_smoothStep]];</code> | ||
|x2= <code>[0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0] [[apply]] { [[_x]] [[call]] [[BIS_fnc_smoothStep]]; }; | |x2= <code>[0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0] [[apply]] { [[_x]] [[call]] [[BIS_fnc_smoothStep]]; }; | ||
{{codecomment|// returns [0, 0.028, 0.104, 0.216, 0.352, 0.5, 0.648, 0.784, 0.896, 0.972, 1]}}</code> | {{codecomment|// returns [0, 0.028, 0.104, 0.216, 0.352, 0.5, 0.648, 0.784, 0.896, 0.972, 1]}}</code> | ||
| | | | ||
}} | }} | ||
Revision as of 23:46, 17 January 2021
Description
- Description:
- Interpolates between 0 and 1 with smoothing at the limits. Formula is
n² × (3 - 2n)
. - Execution:
- call
- Groups:
- Interpolation
Syntax
- Syntax:
- number call BIS_fnc_smoothStep
- Parameters:
- number: Number - a number in range 0..1. A value not in range will be floored to 0 or ceiled to 1
- Return Value:
- Number - interpolation result
Examples
- Example 1:
_smoothedStep = 0.75 call BIS_fnc_smoothStep;
- Example 2:
[0, 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0] apply { _x call BIS_fnc_smoothStep; }; // returns [0, 0.028, 0.104, 0.216, 0.352, 0.5, 0.648, 0.784, 0.896, 0.972, 1]
Additional Information
- See also:
- See also needed
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