BIS fnc distance2Dsqr: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (1 revision)
(Added description, syntax and examples and note about distanceSqr engine command)
Line 8: Line 8:
____________________________________________________________________________________________
____________________________________________________________________________________________


| <pre>
|  
/************************************************************
Distance 2D Squared
 
Parameters: [object or position 1, object or position 2]
 
Returns the SQUARE of the distance between the two objects or
Returns the SQUARE of the distance between the two objects or
positions "as the crow flies" (ignoring elevation).
positions "as the crow flies" (ignoring elevation).
Working in the squared domain is a little faster than using the
fn_distance2D function.


Example: [player, getpos dude] call  BIS_fnc_distance2Dsqr
{{Feature arma3|This function became obsolete with the introduction of [[distanceSqr]]}}
************************************************************/


</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
|= Description
____________________________________________________________________________________________
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_distance2Dsqr]]; --> |= Syntax
| <!-- [] call [[BIS_fnc_distance2Dsqr]]; --> |= Syntax


|p1= |= Parameter 1
|p1=[[Object]] or [[Position]] |= Parameter 1
|p2=[[Object]] or [[Position]] |= Parameter 2


| |= Return value
|[[Number]] - Squared distance |= Return value
____________________________________________________________________________________________
____________________________________________________________________________________________


|x1= <code></code> |=  
|x1= <code>[player, soldier_1] call  BIS_fnc_distance2Dsqr</code> |=
|x2= <code>[[100,100,0],[0,0,0]] call  BIS_fnc_distance2Dsqr</code> |=  
____________________________________________________________________________________________
____________________________________________________________________________________________



Revision as of 12:17, 29 March 2016


Hover & click on the images for description

Description

Description:
Returns the SQUARE of the distance between the two objects or positions "as the crow flies" (ignoring elevation).
Arma 3
This function became obsolete with the introduction of distanceSqr
Execution:
call
Groups:
Uncategorised

Syntax

Syntax:
Syntax needed
Parameters:
Object or Position
Object or Position
Return Value:
Number - Squared distance

Examples

Example 1:
[player, soldier_1] call BIS_fnc_distance2Dsqr
Example 2:
[[100,100,0],[0,0,0]] call BIS_fnc_distance2Dsqr

Additional Information

See also:
See also needed

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