BIS fnc lerpVector: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
(Created page with "{{Function|= Comments | arma3 |Game name= |1.78|Game version= <!---|arg= local |Multiplayer Arguments=---> <!---|eff= local |Multiplayer Effects=---> | <pre>/* Author:...")
 
m (Text replacement - "(\|[pr][0-9]+ *= *[^- ]*) *- *I([a-z ])" to "$1 - i$2")
 
(18 intermediate revisions by 3 users not shown)
Line 1: Line 1:
{{Function|= Comments
{{RV|type=function


| arma3 |Game name=
|game1= arma3
|version1= 1.78


|1.78|Game version=
|gr1= Vectors


<!---|arg= local |Multiplayer Arguments=--->
|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.


<!---|eff= local |Multiplayer Effects=--->
|s1= [currentValue, targetValue, alpha] call [[BIS_fnc_lerpVector]]


| <pre>/*
|p1= currentValue: [[Array]] - vector start
Author:
Nelson Duarte


Description:
|p2= targetValue: [[Array]] - vector end
Given two different vectors A and B, think of a straight line drawn between them
With _alpha saying how far along that line you are


Parameters:
|p3= alpha: [[Number]] - alpha
_this: ARRAY
0: ARRAY - The current value
1: ARRAY - The target value
2: SCALAR - The alpha


Returns:
|r1= [[Array]] - interpolated vector
ARRAY
*/</pre>{{Informative|Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]]}} |Description=


|[] call [[BIS_fnc_lerpVector]]|Syntax=
|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>


|p1= parameter: Datatype - (Optional, default defValue) description |Parameter 1=
|seealso= [[BIS_fnc_clerp]] [[BIS_fnc_slerp]] [[BIS_fnc_lerp]] [[BIS_fnc_inverseLerp]]
 
|Datatype - description|Return value=
 
|x1= <code></code>|Example 1=
 
|exec= call |Execution=
 
| |See also=
}}
}}
[[Category:Function Group: Interp|{{uc:lerpVector}}]]
[[Category:Functions|{{uc:lerpVector}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:lerpVector}}]]

Latest revision as of 16: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