BIS fnc inAngleSector: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
(added formatted description)
Line 1: Line 1:
{{Function|= Comments
{{Function|= Comments
____________________________________________________________________________________________
____________________________________________________________________________________________


| arma2 |= Game name
| arma3 |= Game name


|1.00|= Game version
|1.00|= Game version
____________________________________________________________________________________________
____________________________________________________________________________________________


| <pre>
|Checks if a position lies within an angle sector.|= Description
 
//------------------
// Purpose: Checks if a position lies within an angle sector
// Arguments: [<center position>,<center angle of sector>,<sector width>,<position>]
// Return: boolean
//
/*
Returns true if <position> lies within the sector defined by <center position>,
<center angle of sector> and <sector width>. Use this function to determine if
a position lies within a certain angle from another position (ie the <center position>).
Example:
[position player,getdir player,30,position enemy_tank] call BIS_fnc_inAngleSector
will return true if the vehicle named enemy_tank is within 30 degrees of where the player is pointing.
*/
// Revision History:
// 09/01/08 0.1 - First cut VBS2
//------------------
 
 
</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
____________________________________________________________________________________________
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_inAngleSector]]; --> |= Syntax
| [center, center angle, sector width, position ] call [[BIS_fnc_inAngleSector]]; |= Syntax
|p1= center : [[Array]] - Center position  |= Parameter 1
|p2= center angle : [[Number]] - Defines the center angle of the sector  |= Parameter 2
|p3= sector width : [[Number]] - Defines the width of the sector in degrees  |= Parameter 3
|p4= position : [[Array]] - The position which should be checked  |= Parameter 4


|p1= |= Parameter 1
| [[Boolean]]: Returns [[true]] if the position lies within sector|= Return value
 
| |= Return value
____________________________________________________________________________________________
____________________________________________________________________________________________
 
|x1=<code>[ [[position]] [[player]], [[getDir]] [[player]], 30, [[position]] enemy_tank ] [[call]] '''BIS_fnc_inAngleSector'''</code> |=  
|x1= <code></code> |=  
____________________________________________________________________________________________
____________________________________________________________________________________________


Line 43: Line 25:


}}
}}
<h3 style="display:none">Notes</h3>
<dl class="command_description">
<!-- Note Section BEGIN -->
<!-- Note Section END -->
</dl>
<h3 style="display:none">Bottom Section</h3>
[[Category:Function Group: Geometry|{{uc:inAngleSector}}]]
[[Category:Functions|{{uc:inAngleSector}}]]
[[Category:{{Name|arma2}}: Functions|{{uc:inAngleSector}}]]
[[Category:{{Name|arma2oa}}: Functions|{{uc:inAngleSector}}]]
[[Category:{{Name|tkoh}}: Functions|{{uc:inAngleSector}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:inAngleSector}}]]

Revision as of 09:22, 25 July 2017


Hover & click on the images for description

Description

Description:
Checks if a position lies within an angle sector.
Execution:
call
Groups:
Uncategorised

Syntax

Syntax:
[center, center angle, sector width, position ] call BIS_fnc_inAngleSector;
Parameters:
center : Array - Center position
center angle : Number - Defines the center angle of the sector
sector width : Number - Defines the width of the sector in degrees
position : Array - The position which should be checked
Return Value:
Boolean: Returns true if the position lies within sector

Examples

Example 1:
[ position player, getDir player, 30, position enemy_tank ] call BIS_fnc_inAngleSector

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