BIS fnc lerpVector: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " {2,}\}\}" to " }}")
m (Text replacement - "(\|[pr][0-9]+ *= *[^- ]*) *- *I([a-z ])" to "$1 - i$2")
 
(11 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Function
{{RV|type=function


|game1= arma3
|game1= arma3
|version1= 1.78
|version1= 1.78


|gr1 = Vectors
|gr1= Vectors


|descr= Given two different vectors A and B, think of a straight line drawn between them
|descr= Given two different vectors A and B, think of a straight line drawn between them, ''alpha'' saying how far along that line is the wanted vector.
With _alpha saying how far along that line you are


|s1= [currentValue, targetValue, alpha] call [[BIS_fnc_lerpVector]]
|s1= [currentValue, targetValue, alpha] call [[BIS_fnc_lerpVector]]


|p1= currentValue: [[Array]] - Vector Start
|p1= currentValue: [[Array]] - vector start
 
|p2= targetValue: [[Array]] - Vector End


|p3= alpha: [[Number]] - Alpha
|p2= targetValue: [[Array]] - vector end


|r1= [[Array]] - Interpolated vector
|p3= alpha: [[Number]] - alpha


|x1= <code>[<noWiki>[</noWiki>1592.74,6558.36,0],[2240.43,7459.69,0],0.3] [[call]] [[BIS_fnc_lerpVector]];{{cc|Returns [1787.05,6828.76,0]}}</code>
|r1= [[Array]] - interpolated vector


|exec= call
|x1= <sqf>[[1592.74,6558.36,0], [2240.43,7459.69,0], 0.3] call BIS_fnc_lerpVector; // returns [1787.05,6828.76,0]</sqf>


|seealso= [[BIS_fnc_clerp]] [[BIS_fnc_slerp]] [[BIS_fnc_lerp]] [[BIS_fnc_inverseLerp]]
|seealso= [[BIS_fnc_clerp]] [[BIS_fnc_slerp]] [[BIS_fnc_lerp]] [[BIS_fnc_inverseLerp]]
}}
}}
[[Category:Functions|{{uc:lerpVector}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:lerpVector}}]]

Latest revision as of 15:33, 8 November 2023

Hover & click on the images for description

Description

Description:
Given two different vectors A and B, think of a straight line drawn between them, alpha saying how far along that line is the wanted vector.
Execution:
call
Groups:
Vectors

Syntax

Syntax:
[currentValue, targetValue, alpha] call BIS_fnc_lerpVector
Parameters:
currentValue: Array - vector start
targetValue: Array - vector end
alpha: Number - alpha
Return Value:
Array - interpolated vector

Examples

Example 1:
[[1592.74,6558.36,0], [2240.43,7459.69,0], 0.3] call BIS_fnc_lerpVector; // returns [1787.05,6828.76,0]

Additional Information

See also:
BIS_fnc_clerp BIS_fnc_slerp BIS_fnc_lerp BIS_fnc_inverseLerp

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