BIS fnc getIntersectionsUnderCursor: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (Text replacement - " <h3 style="display:none">Notes</h3> <dl class="command_description"> <!-- Note Section BEGIN --> <!-- Note Section END --> </dl>" to "")
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|Comments=
{{Function


| arma3 |Game name=
| arma3


|1.00|Game version=
|1.00


|gr1 = Geometry|GROUP1=
|gr1 = Geometry


| Returns intersections under cursor. For more information see [[lineIntersectsSurfaces]]. |Description=
| Returns intersections under cursor. For more information see [[lineIntersectsSurfaces]].


| [begPosASL, endPosASL, ignoreObj1, ignoreObj2, sortMode, maxResults] call [[BIS_fnc_getIntersectionsUnderCursor]] |Syntax=
| [begPosASL, endPosASL, ignoreObj1, ignoreObj2, sortMode, maxResults] call [[BIS_fnc_getIntersectionsUnderCursor]]




|p1= [begPosASL, endPosASL, ignoreObj1, ignoreObj2, sortMode, maxResults, LOD1, LOD2]: [[Array]]| Parameter 1 =
|p1= [begPosASL, endPosASL, ignoreObj1, ignoreObj2, sortMode, maxResults, LOD1, LOD2]: [[Array]]
|p2= begPosASL: [[PositionASL]] - virtual line start | Parameter 2 =
|p2= begPosASL: [[PositionASL]] - virtual line start
|p3= endPosASL: [[PositionASL]] - virtual line end | Parameter 3 =
|p3= endPosASL: [[PositionASL]] - virtual line end
|p4= ignoreObj1 (Optional): [[Object]] - first object to ignore or [[objNull]]: Default: [[objNull]]| Parameter 4 =
|p4= ignoreObj1 (Optional): [[Object]] - first object to ignore or [[objNull]]: Default: [[objNull]]
|p5= ignoreObj2 (Optional): [[Object]] - second object to ignore or [[objNull]]: Default: [[objNull]] | Parameter 5 =
|p5= ignoreObj2 (Optional): [[Object]] - second object to ignore or [[objNull]]: Default: [[objNull]]
|p6= sortMode (Optional): [[Boolean]] - [[true]]: closest to furthest, [[false]]: furthest to closest. Default: [[true]] | Parameter 6 =
|p6= sortMode (Optional): [[Boolean]] - [[true]]: closest to furthest, [[false]]: furthest to closest. Default: [[true]]
|p7= maxResults (Optional): [[Number]] - Max results to return. -1 to return every result. Default: 1| Parameter 7 =
|p7= maxResults (Optional): [[Number]] - Max results to return. -1 to return every result. Default: 1


|[[Array]] of intersections in format [<nowiki/>[intersectPosASL, surfaceNormal, intersectObj, parentObject],...] where:
|[[Array]] of intersections in format [<nowiki/>[intersectPosASL, surfaceNormal, intersectObj, parentObject],...] where:
Line 24: Line 24:
* [[surfaceNormal]] - a normal to the intersected surface  
* [[surfaceNormal]] - a normal to the intersected surface  
* intersectObject - the object the surface belongs to (could be proxy object) - [[objNull]] if terrain
* intersectObject - the object the surface belongs to (could be proxy object) - [[objNull]] if terrain
* parentObject - the object proxy object belongs to (not always the same as intersect object) - objNull if terrain |Return value=
* parentObject - the object proxy object belongs to (not always the same as intersect object) - objNull if terrain


|x1= <code>[ [[eyePos]] [[player]], [[aimPos]] chopper, [[player]], chopper, [[true]] ] [[call]] [[BIS_fnc_getIntersectionsUnderCursor]];</code> |Example 1=
|x1= <code>[ [[eyePos]] [[player]], [[aimPos]] chopper, [[player]], chopper, [[true]] ] [[call]] [[BIS_fnc_getIntersectionsUnderCursor]];</code>


| [[lineIntersectsSurfaces]] |See also=
| [[lineIntersectsSurfaces]]
}}
}}



Revision as of 00:03, 18 January 2021

Hover & click on the images for description

Description

Description:
Returns intersections under cursor. For more information see lineIntersectsSurfaces.
Execution:
call
Groups:
Geometry

Syntax

Syntax:
[begPosASL, endPosASL, ignoreObj1, ignoreObj2, sortMode, maxResults] call BIS_fnc_getIntersectionsUnderCursor
Parameters:
[begPosASL, endPosASL, ignoreObj1, ignoreObj2, sortMode, maxResults, LOD1, LOD2]: Array
begPosASL: PositionASL - virtual line start
endPosASL: PositionASL - virtual line end
ignoreObj1 (Optional): Object - first object to ignore or objNull: Default: objNull
ignoreObj2 (Optional): Object - second object to ignore or objNull: Default: objNull
sortMode (Optional): Boolean - true: closest to furthest, false: furthest to closest. Default: true
maxResults (Optional): Number - Max results to return. -1 to return every result. Default: 1
Return Value:
Array of intersections in format [[intersectPosASL, surfaceNormal, intersectObj, parentObject],...] where:
  • intersectPosASL - the actual position where line intersects surface
  • surfaceNormal - a normal to the intersected surface
  • intersectObject - the object the surface belongs to (could be proxy object) - objNull if terrain
  • parentObject - the object proxy object belongs to (not always the same as intersect object) - objNull if terrain

Examples

Example 1:
[ eyePos player, aimPos chopper, player, chopper, true ] call BIS_fnc_getIntersectionsUnderCursor;

Additional Information

See also:
lineIntersectsSurfaces

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


Bottom Section