BIS fnc isInsideArea: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - " <h3 style="display:none">Notes</h3> <dl class="command_description"> <!-- Note Section BEGIN --> <!-- Note Section END --> </dl>" to "") |
Lou Montana (talk | contribs) 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 | {{Function | ||
| arma3 | | arma3 | ||
|1.00 | |1.00 | ||
|gr1 = Geometry | |gr1 = Geometry | ||
| Detects whether a position is within a square area of given size about center. | | Detects whether a position is within a square area of given size about center. | ||
| [center, size, position ] call [[BIS_fnc_isInsideArea]] | | [center, size, position ] call [[BIS_fnc_isInsideArea]] | ||
|p1= center: [[Array]] - Center [[Position]] of area to check | |p1= center: [[Array]] - Center [[Position]] of area to check | ||
|p2= size: [[Array]] - [x,y] offsets from center | |p2= size: [[Array]] - [x,y] offsets from center | ||
|p3= position: [[Array]] - [[Position]] to check | |p3= position: [[Array]] - [[Position]] to check | ||
| [[Boolean]] - true when position is in area, false otherwise | | [[Boolean]] - true when position is in area, false otherwise | ||
|x1= <code>{{cc|Check an area, centered on the player that is 10m wide and 10m tall}} | |x1= <code>{{cc|Check an area, centered on the player that is 10m wide and 10m tall}} | ||
_size = [5, 5]; | _size = [5, 5]; | ||
_checkPos = [[getPos]] [[player]]; | _checkPos = [[getPos]] [[player]]; | ||
_inArea = [_checkPos, _size, _checkPos] [[call]] [[BIS_fnc_isInsideArea]];</code> | _inArea = [_checkPos, _size, _checkPos] [[call]] [[BIS_fnc_isInsideArea]];</code> | ||
| [[createTrigger]] [[createMarker]] [[setTriggerArea]] [[setMarkerSize]] [[triggerArea]] [[markerSize]] [[BIS_fnc_inAngleSector]] | | [[createTrigger]] [[createMarker]] [[setTriggerArea]] [[setMarkerSize]] [[triggerArea]] [[markerSize]] [[BIS_fnc_inAngleSector]] | ||
}} | }} | ||
Revision as of 23:08, 17 January 2021
Description
- Description:
- Detects whether a position is within a square area of given size about center.
- Execution:
- call
- Groups:
- Geometry
Syntax
- Syntax:
- [center, size, position ] call BIS_fnc_isInsideArea
- Parameters:
- center: Array - Center Position of area to check
- size: Array - [x,y] offsets from center
- position: Array - Position to check
- Return Value:
- Boolean - true when position is in area, false otherwise
Examples
- Example 1:
// Check an area, centered on the player that is 10m wide and 10m tall _size = [5, 5]; _checkPos = getPos player; _inArea = [_checkPos, _size, _checkPos] call BIS_fnc_isInsideArea;
Additional Information
- See also:
- createTrigger createMarker setTriggerArea setMarkerSize triggerArea markerSize BIS_fnc_inAngleSector
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