BIS fnc inAngleSector: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (Some wiki formatting)
 
(36 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{Function|= Comments
{{RV|type=function
____________________________________________________________________________________________


| arma2 |= Game name
|game1= arma3
|version1= 1.00


|1.00|= Game version
|gr1= Geometry
____________________________________________________________________________________________


| <pre>
|descr= [[File:BIS_fnc_inAngleSector.jpg|500px|right]]
Checks if a position lies within an angle sector.


//------------------
|s1= [center, centerAngle, sectorWidth, position] call [[BIS_fnc_inAngleSector]]
// 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
//------------------


|p1= center : [[Array]] - center position


</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
|p2= centerAngle : [[Number]] - defines the center angle of the sector
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_inAngleSector]]; --> |= Syntax
|p3= sectorWidth: [[Number]] - defines the width of the sector in degrees


|p1= |= Parameter 1
|p4= position: [[Array]] - the position which should be checked


| |= Return value
|r1= [[Boolean]] - [[true]] if the position lies within the defined sector
____________________________________________________________________________________________


|x1= <code></code> |=
|x1= <sqf>[getPosWorld player, getDir player, 30, getPosWorld enemy_tank] call BIS_fnc_inAngleSector;</sqf>
____________________________________________________________________________________________
 
| |= See also


|seealso= [[BIS_fnc_isInFrontOf]]
}}
}}
<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}}]]

Latest revision as of 19:06, 18 January 2023

Hover & click on the images for description

Description

Description:
BIS fnc inAngleSector.jpg
Checks if a position lies within an angle sector.
Execution:
call
Groups:
Geometry

Syntax

Syntax:
[center, centerAngle, sectorWidth, position] call BIS_fnc_inAngleSector
Parameters:
center : Array - center position
centerAngle : Number - defines the center angle of the sector
sectorWidth: Number - defines the width of the sector in degrees
position: Array - the position which should be checked
Return Value:
Boolean - true if the position lies within the defined sector

Examples

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

Additional Information

See also:
BIS_fnc_isInFrontOf

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