vectorLinearConversion: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
(Format example description)
Line 13: Line 13:
____________________________________________________________________________________________
____________________________________________________________________________________________


| Converts given vector from given "from" range to wanted "to" range. If clipping is set to true, the resulting value is guaranteed to be within "to" range no matter what. |Description=
| Interpolates vector between the given "vectorFrom" and "vectorTo" value according to the given range value|Description=
____________________________________________________________________________________________
____________________________________________________________________________________________


| [[vectorLinearConversion]] [minFrom, maxFrom, value, vector3Min, vector3Max, clip] |Syntax=
| [[vectorLinearConversion]] [rangeFrom, rangeTo, rangeValue, vectorFrom, vectorTo, clip] |Syntax=


|p1=[minFrom, maxFrom, value, vector3Min, vector3Max, clip]: [[Array]]
|p1=[rangeFrom, rangeTo, rangeValue, vectorFrom, vectorTo, clip]: [[Array]]


|p2=minFrom: [[Number]] - start "from" range
|p2=rangeFrom: [[Number]] - start "from" range


|p3=maxFrom: [[Number]] - end "from" range
|p3=rangeTo: [[Number]] - end "to" range


|p4=value: [[Number]] - given value from "from" range
|p4=rangeValue: [[Number]] - variable range value


|p5=vector3Min: [[Array]] - start "to" range
|p5=vectorFrom: [[Array]] - start "from" vector


|p6=vector3Max: [[Array]] - end "to" range
|p6=vectorTo: [[Array]] - end "to" vector


|p7=clip (Optional): [[Boolean]] - if true, resulting value cannot leave "to" range. Default: [[false]]
|p7=clip (Optional): [[Boolean]] - if [[true]], range value will be clipped to stay within "from" - "to" range. Default: [[false]]


| Array |Return Value=
| [[Array]] - interpolated vector |Return Value=
____________________________________________________________________________________________
____________________________________________________________________________________________


|x1= <code>vectorLinearConversion [0,1,0.5,[0,0,0],[25,50,100],false];//[12.5,25,50]</code> |Example 1=
|x1= <code>[[vectorLinearConversion]] [0,1,0.5,[0,0,0],[25,50,100],[[false]]]; // [12.5,25,50]</code> |Example 1=
|x2= <code>[[vectorLinearConversion]] [0,1,100,[0,0,0],[25,50,100],[[true]]]; // [25,50,100]</code> |Example 2=
____________________________________________________________________________________________
____________________________________________________________________________________________



Revision as of 06:43, 18 September 2019

Hover & click on the images for description

Description

Description:
Interpolates vector between the given "vectorFrom" and "vectorTo" value according to the given range value
Multiplayer:
-
Groups:
Uncategorised

Syntax

Syntax:
vectorLinearConversion [rangeFrom, rangeTo, rangeValue, vectorFrom, vectorTo, clip]
Parameters:
[rangeFrom, rangeTo, rangeValue, vectorFrom, vectorTo, clip]: Array
rangeFrom: Number - start "from" range
rangeTo: Number - end "to" range
rangeValue: Number - variable range value
vectorFrom: Array - start "from" vector
vectorTo: Array - end "to" vector
clip (Optional): Boolean - if true, range value will be clipped to stay within "from" - "to" range. Default: false
Return Value:
Array - interpolated vector

Examples

Example 1:
vectorLinearConversion [0,1,0.5,[0,0,0],[25,50,100],false]; // [12.5,25,50]
Example 2:
vectorLinearConversion [0,1,100,[0,0,0],[25,50,100],true]; // [25,50,100]

Additional Information

See also:
linearConversion

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

Bottom Section