BIS fnc nearestPoint: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - "\[\[Category\:Function Group\: Geometry(\|\{\{[a-zA-Z0-9_:]+\}\})?\]\]" to "")
m (Text replacement - "_{10,} " to "")
Line 1: Line 1:
{{Function|Comments=
{{Function|Comments=
____________________________________________________________________________________________


| arma2 |Game name=
| arma2 |Game name=
Line 7: Line 6:


|gr1 = Geometry |GROUP1=
|gr1 = Geometry |GROUP1=
____________________________________________________________________________________________


| Computes nearest point in a line. |Description=
| Computes nearest point in a line. |Description=
____________________________________________________________________________________________


| [start, end, point, ''is2D''] call [[BIS_fnc_nearestPoint]] |Syntax=
| [start, end, point, ''is2D''] call [[BIS_fnc_nearestPoint]] |Syntax=
Line 23: Line 20:


| [[Position]] - the line point that is closest to ''point'' |Return value=
| [[Position]] - the line point that is closest to ''point'' |Return value=
____________________________________________________________________________________________


|x1= <code>_idealLocation = [<nowiki/>[[getMarkerPos]] "base", [[getMarkerPos]] "destination", [[getPos]] [[player]], [[true]]] [[call]] [[BIS_fnc_nearestPoint]];</code> |Example 1=
|x1= <code>_idealLocation = [<nowiki/>[[getMarkerPos]] "base", [[getMarkerPos]] "destination", [[getPos]] [[player]], [[true]]] [[call]] [[BIS_fnc_nearestPoint]];</code> |Example 1=
____________________________________________________________________________________________


| [[nearObjects]], [[nearestObject]], [[nearestObjects]], [[BIS_fnc_nearestPosition]], [[BIS_fnc_nearestNum]], [[BIS_fnc_nearestRoad]], [[BIS_fnc_nearestHelipad]], [[BIS_fnc_isPosBlacklisted]] |See also=
| [[nearObjects]], [[nearestObject]], [[nearestObjects]], [[BIS_fnc_nearestPosition]], [[BIS_fnc_nearestNum]], [[BIS_fnc_nearestRoad]], [[BIS_fnc_nearestHelipad]], [[BIS_fnc_isPosBlacklisted]] |See also=

Revision as of 00:30, 17 January 2021

Hover & click on the images for description

Description

Description:
Computes nearest point in a line.
Execution:
call
Groups:
Geometry

Syntax

Syntax:
[start, end, point, is2D] call BIS_fnc_nearestPoint
Parameters:
start: Position - line start
end: Position - line end
point: Position - point to check against
is2D: Boolean - (Optional, default false) 2D calculation instead of 3D
Return Value:
Position - the line point that is closest to point

Examples

Example 1:
_idealLocation = [getMarkerPos "base", getMarkerPos "destination", getPos player, true] call BIS_fnc_nearestPoint;

Additional Information

See also:
nearObjectsnearestObjectnearestObjectsBIS_fnc_nearestPositionBIS_fnc_nearestNumBIS_fnc_nearestRoadBIS_fnc_nearestHelipadBIS_fnc_isPosBlacklisted

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

Notes

Bottom Section