BIS fnc nearestPoint: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " <h3 style="display:none">Notes</h3> <dl class="command_description"> <!-- Note Section BEGIN --> <!-- Note Section END --> </dl> " to "")
m (Text replacement - " *\| *([Cc]omments|COMMENTS|[Gg]ame [Nn]ame|Game [Vv]ersion|Game Version \(number surrounded by NO SPACES\)|Multiplayer Arguments \("local" or "global"\)|Multiplayer Effects \("local" or "global"\)|Multiplayer Execution \("server" o...)
Line 1: Line 1:
{{Function|Comments=
{{Function


| arma2 |Game name=
| arma2


|1.00|Game version=
|1.00


|gr1 = Geometry |GROUP1=
|gr1 = Geometry


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


| [start, end, point, ''is2D''] call [[BIS_fnc_nearestPoint]] |Syntax=
| [start, end, point, ''is2D''] call [[BIS_fnc_nearestPoint]]


|p1= start: [[Position]] - line start |Parameter 1=
|p1= start: [[Position]] - line start


|p2= end: [[Position]] - line end |Parameter 2=
|p2= end: [[Position]] - line end


|p3= point: [[Position]] - point to check against |Parameter 3=
|p3= point: [[Position]] - point to check against


|p4= is2D: [[Boolean]] - (Optional, default [[false]]) 2D calculation instead of 3D |Parameter 4=
|p4= is2D: [[Boolean]] - (Optional, default [[false]]) 2D calculation instead of 3D


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


|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>


| [[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]]
}}
}}



Revision as of 00:38, 18 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

Bottom Section