BIS fnc getIntersectionsUnderCursor: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
m (pf)
m (Text replacement - "|size=0.8" to "|size= 0.75")
 
(33 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{Function|Comments=
{{RV|type=function
____________________________________________________________________________________________


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


|1.00|Game version=
|gr1= Geometry
____________________________________________________________________________________________


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


| [begPosASL, endPosASL, ignoreObj1, ignoreObj2, sortMode, maxResults] call [[BIS_fnc_getIntersectionsUnderCursor]] |Syntax=
|s1= [screenX, screenY, ignoreObj1, ignoreObj2, sortMode, maxResults, LOD1, LOD2] call [[BIS_fnc_getIntersectionsUnderCursor]]


|p1= screenX: [[Number]] - (Optional, default 0) cursor's X position - see [[screenToWorld]]


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


|[[Array]] of intersections in format <nowiki>[</nowiki>[intersectPosASL, surfaceNormal, intersectObj, parentObject],...] where:
|p3= ignoreObj1: [[Object]] - (Optional, default [[objNull]]) first object to ignore
* 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 |= Return value
____________________________________________________________________________________________


|x1= <code>[ [[eyePos]] [[player]], [[aimPos]] chopper, [[player]], chopper, [[true]] ] [[call]] [[BIS_fnc_getIntersectionsUnderCursor]];</code> |Example 1=
|p4= ignoreObj2: [[Object]] - (Optional, default [[objNull]]) second object to ignore
____________________________________________________________________________________________


| [[lineIntersectsSurfaces]] |See also=
|p5= sortMode: [[Boolean]] - (Optional, default [[true]]) [[true]]: closest to furthest, [[false]]: furthest to closest
}}
 
|p6= maxResults: [[Number]] - (Optional, default 1) max results to return. -1 to return every result
 
|p7= LOD1: [[String]] - (Optional, default "VIEW") primary [[LOD]] to look for intersection. Can be one of:
* "FIRE"
* "VIEW"
* "GEOM"
* "IFIRE" - ("I" stands for Indirect, ''almost'' identical to "FIRE")
* "NONE"
* {{GVI|arma3|2.02|size= 0.75}} "PHYSX" - PhysX geometry LOD
* {{GVI|arma3|2.08|size= 0.75}} "ROADWAY" - only works from the top
|p7since= arma3 1.52


|p8= LOD2: [[String]] - (Optional, default "FIRE") secondary [[LOD]] to look for intersection. See ''LOD1'' for possible values
|p8since= arma3 1.52


<h3 style="display:none">Notes</h3>
|r1= [[Array]] of intersections in format [<nowiki/>[intersectPosASL, surfaceNormal, intersectObj, parentObject, selectionNames, pathToBisurf], ...] where:
<dl class="command_description">
* intersectPosASL: [[PositionASL]] - the actual position where line intersects surface
<!-- Note Section BEGIN -->
* [[surfaceNormal]]: [[Vector]] - a normal to the intersected surface
* intersectObject: [[Object]] - the object the surface belongs to (could be proxy object) - [[objNull]] if terrain
* parentObject: [[Object]] - the object proxy object belongs to (not always the same as intersect object) - [[objNull]] if terrain
* {{GVI|arma3|2.10|size= 0.75}} [[selectionNames]]: [[Array]] of [[String]]s - Names of the intersected selections (bones). Returns {{hl|[]}} if there is no intersection with a selection.
* {{GVI|arma3|2.10|size= 0.75}} pathToBisurf: [[String]] - path to intersected surface properties (.bisurf) file. Returns {{hl|""}} if surface has no special properties. Terrain surface properties begin with {{hl|#}}, and the surface properties are defined in {{hl|CfgSurfaces}}. For example, if it returns {{hl|#GdtVRsurface01}}, properties are defined in: <sqf inline>configFile >> "CfgSurfaces" >> "GdtVRsurface01"</sqf>


<!-- Note Section END -->
|x1= <sqf>[0.5, 0.5, player, objNull, true, "VIEW"] call BIS_fnc_getIntersectionsUnderCursor;</sqf>
</dl>


<h3 style="display:none">Bottom Section</h3>
|seealso= [[lineIntersectsSurfaces]]
[[Category:Function Group: Misc|{{uc:getIntersectionsUnderCursor}}]]
}}
[[Category:Functions|{{uc:getIntersectionsUnderCursor}}]]
[[Category:{{Name|arma3}}: Functions|{{uc:getIntersectionsUnderCursor}}]]

Latest revision as of 13:10, 21 December 2022

Hover & click on the images for description

Description

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

Syntax

Syntax:
[screenX, screenY, ignoreObj1, ignoreObj2, sortMode, maxResults, LOD1, LOD2] call BIS_fnc_getIntersectionsUnderCursor
Parameters:
screenX: Number - (Optional, default 0) cursor's X position - see screenToWorld
screenY: Number - (Optional, default 0) cursor's Y position - see screenToWorld
ignoreObj1: Object - (Optional, default objNull) first object to ignore
ignoreObj2: Object - (Optional, default objNull) second object to ignore
sortMode: Boolean - (Optional, default true) true: closest to furthest, false: furthest to closest
maxResults: Number - (Optional, default 1) max results to return. -1 to return every result
since Arma 3 logo black.png1.52
LOD1: String - (Optional, default "VIEW") primary LOD to look for intersection. Can be one of:
  • "FIRE"
  • "VIEW"
  • "GEOM"
  • "IFIRE" - ("I" stands for Indirect, almost identical to "FIRE")
  • "NONE"
  • Arma 3 logo black.png2.02 "PHYSX" - PhysX geometry LOD
  • Arma 3 logo black.png2.08 "ROADWAY" - only works from the top
since Arma 3 logo black.png1.52
LOD2: String - (Optional, default "FIRE") secondary LOD to look for intersection. See LOD1 for possible values
Return Value:
Array of intersections in format [[intersectPosASL, surfaceNormal, intersectObj, parentObject, selectionNames, pathToBisurf], ...] where:
  • intersectPosASL: PositionASL - the actual position where line intersects surface
  • surfaceNormal: Vector - a normal to the intersected surface
  • intersectObject: Object - the object the surface belongs to (could be proxy object) - objNull if terrain
  • parentObject: Object - the object proxy object belongs to (not always the same as intersect object) - objNull if terrain
  • Arma 3 logo black.png2.10 selectionNames: Array of Strings - Names of the intersected selections (bones). Returns [] if there is no intersection with a selection.
  • Arma 3 logo black.png2.10 pathToBisurf: String - path to intersected surface properties (.bisurf) file. Returns "" if surface has no special properties. Terrain surface properties begin with #, and the surface properties are defined in CfgSurfaces. For example, if it returns #GdtVRsurface01, properties are defined in: configFile >> "CfgSurfaces" >> "GdtVRsurface01"

Examples

Example 1:
[0.5, 0.5, player, objNull, true, "VIEW"] 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