vectorLinearConversion: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\| *arma3 * * *\| *([0-2]\.[0-9]{2}) * " to "|game1= arma3 |version1= $1 ")
m (Text replacement - " \| *(game[0-9]|version[0-9]|gr[0-9]|serverExec|mp|pr|descr|s[0-9]|p[0-9]{1,3}|r[0-9]|x1?[0-9]|seealso) *= +" to " |$1= ")
Line 8: Line 8:
|descr= Interpolates vector between the given "vectorFrom" and "vectorTo" value according to the given range value
|descr= Interpolates vector between the given "vectorFrom" and "vectorTo" value according to the given range value


|s1= [[vectorLinearConversion]] [rangeFrom, rangeTo, rangeValue, vectorFrom, vectorTo, clip]
|s1= [[vectorLinearConversion]] [rangeFrom, rangeTo, rangeValue, vectorFrom, vectorTo, clip]


|p1=[rangeFrom, rangeTo, rangeValue, vectorFrom, vectorTo, clip]: [[Array]]
|p1=[rangeFrom, rangeTo, rangeValue, vectorFrom, vectorTo, clip]: [[Array]]

Revision as of 22:51, 19 June 2021

Hover & click on the images for description

Description

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

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]
Example 3:
vectorLinearConversion [0,1,100,[0,0,0],[25,50,100],false]; // [2500,5000,10000]

Additional Information

See also:
linearConversionbezierInterpolationmatrixMultiplymatrixTranspose

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