BIS fnc isInFrontOf: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Generated by BIS_fnc_exportFunctionsToWiki)
 
m (Text replacement - "= <code>([^<{]+)<\/code>" to "= <sqf>$1</sqf>")
 
(39 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{{RV|type=function


{{Function|= Comments
|game1= arma2
____________________________________________________________________________________________
|version1= 1.00


| arma2 |= Game name
|game2= arma2oa
|version2= 1.50


|1.00|= Game version
|game3= tkoh
____________________________________________________________________________________________
|version3= 1.00


| <pre>
|game4= arma3
|version4= 0.50


//------------------
|gr1= Object Manipulation
// Purpose: This function checks, if a object is in front of another object
// Arguments: [object1, object2, offset (> 0 if position of object1 is not the front of object1)]
// Return: boolean
//
// Revision History:
// 20/11/06 0.1 - First cut
// 24/11/06 0.1 - added offset
//------------------


|gr2= Geometry


</pre><small>''(Placeholder description extracted from the function header by [[BIS_fnc_exportFunctionsToWiki]])''</small> |= Description
|descr= Check if an object is in front of another object (in the front 180°)
____________________________________________________________________________________________


| <!-- [] call [[BIS_fnc_isInFrontOf]]; --> |= Syntax
|s1= [reference, checked, offset] call [[BIS_fnc_isInFrontOf]]


|p1= |= Parameter 1
|p1= reference: [[Object]] - the reference object


| |= Return value
|p2= checked: [[Object]] - the object that has to be in front of ''reference''
____________________________________________________________________________________________


|x1= <code></code> |=
|p3= offset: [[Number]] - (Optional, default 0) allows to check from ''offset'' meters in front of (positive), or behind (negative) ''reference''
____________________________________________________________________________________________


| |= See also
|r1= [[Boolean]]


|x1= <sqf>private _isInstructorInFrontOfPlayer = [player, instructor, 0] call BIS_fnc_isInFrontOf;</sqf>
|seealso= [[getRelDir]] [[BIS_fnc_isInsideArea]]
}}
}}
<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: Objects|{{uc:isInFrontOf}}]]
[[Category:Functions|{{uc:isInFrontOf}}]]
[[Category:{{Name|arma2}}: Functions|{{uc:isInFrontOf}}]]
[[Category:{{Name|arma2oa}}: Functions|{{uc:isInFrontOf}}]]
[[Category:{{Name|tkoh}}: Functions|{{uc:isInFrontOf}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:isInFrontOf}}]]

Latest revision as of 17:00, 13 July 2022

Hover & click on the images for description

Description

Description:
Check if an object is in front of another object (in the front 180°)
Execution:
call
Groups:
Object ManipulationGeometry

Syntax

Syntax:
[reference, checked, offset] call BIS_fnc_isInFrontOf
Parameters:
reference: Object - the reference object
checked: Object - the object that has to be in front of reference
offset: Number - (Optional, default 0) allows to check from offset meters in front of (positive), or behind (negative) reference
Return Value:
Boolean

Examples

Example 1:
private _isInstructorInFrontOfPlayer = [player, instructor, 0] call BIS_fnc_isInFrontOf;

Additional Information

See also:
getRelDir BIS_fnc_isInsideArea

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