intersect: Difference between revisions
Jump to navigation
Jump to search
Lou Montana (talk | contribs) m (Text replacement - "</dl> <dl class="command_description"> " to "") |
Lou Montana (talk | contribs) m (Some wiki formatting) |
||
Line 25: | Line 25: | ||
* "GEOM" | * "GEOM" | ||
* "IFIRE" - ("I" stands for Indirect, almost the same as FIRE) | * "IFIRE" - ("I" stands for Indirect, almost the same as FIRE) | ||
* "PHYSX" - PhysX geometry LOD | * {{GVI|arma3|2.02|size= 0.75}} "PHYSX" - PhysX geometry LOD | ||
|s1= [object, lodName] [[intersect]] [begPos, endPos] | |s1= [object, lodName] [[intersect]] [begPos, endPos] | ||
|p1= [object, lodName]: [[Array]] | |p1= [object, lodName]: [[Array]] | ||
|p2= object: [[Object]] | |p2= object: [[Object]] | ||
|p3= lodName: [[String]] | |p3= lodName: [[String]] | ||
|p4= [begPos, endPos] : [[Array]] | |p4= [begPos, endPos] : [[Array]] | ||
|p5= begPos: [[Array]] - format [[PositionAGL]] | |p5= begPos: [[Array]] - format [[PositionAGL]] | ||
|p6= endPos: [[Array]] - format [[PositionAGL]] | |p6= endPos: [[Array]] - format [[PositionAGL]] | ||
Line 59: | Line 64: | ||
[[drawIcon3D]] ["", [1,1,1,1], [[ASLToAGL]] _posASL, 0, 0, 0, _name, 1, 0.03, "PuristaMedium"]; | [[drawIcon3D]] ["", [1,1,1,1], [[ASLToAGL]] _posASL, 0, 0, 0, _name, 1, 0.03, "PuristaMedium"]; | ||
sphere [[setPosASL]] _posASL; | sphere [[setPosASL]] _posASL; | ||
};</code> | };</code> | ||
|seealso= [[lineIntersectsSurfaces]], [[terrainIntersect]], [[terrainIntersectASL]], [[terrainIntersectAtASL]], [[lineIntersects]], [[lineIntersectsWith]], [[lineIntersectsObjs]], [[cursorObject]], [[cursorTarget]], [[checkVisibility]] | |seealso= [[lineIntersectsSurfaces]], [[terrainIntersect]], [[terrainIntersectASL]], [[terrainIntersectAtASL]], [[lineIntersects]], [[lineIntersectsWith]], [[lineIntersectsObjs]], [[cursorObject]], [[cursorTarget]], [[checkVisibility]] | ||
}} | }} | ||
{{Note | |||
|user= ManDay | |||
|timestamp= 20070725083700 | |||
|text= The most common [[LOD]] is "''FIRE''", which identifies the most detailled hitbox used for ammunition. | |||
}} | |||
{{Note | |||
|user= ffur2007slx2_5 | |||
|timestamp= 20140327145200 | |||
|text= Example (In {{arma3}} ver 1.14) display returned arrays on cursor entities: | |||
Example (In {{arma3}} ver 1.14) display returned arrays on cursor entities: | |||
<code>Sto = []; | <code>Sto = []; | ||
Fn = { | Fn = { | ||
{ | |||
Sto [[set]] [_foreachindex,[<nowiki/>[[cursorTarget]], _x] [[intersect]] [<nowiki/>[[ASLToAGL]] [[eyePos]] [[player]], [[screenToWorld]] [0.5,0.5]]]; | |||
} [[foreach]] ["FIRE", "VIEW", "GEOM", "IFIRE"]; | |||
[[hintSilent]] [[format]] ["FIRE: %1, VIEW: %2, GEOM: %3, IFIRE: %4",Sto [[select]] 0, Sto [[select]] 1, Sto [[select]] 2, Sto [[select]] 3]; | |||
}; | }; | ||
["sample_id","onEachFrame","Fn"] call BIS_fnc_addStackedEventHandler; | ["sample_id", "onEachFrame", "Fn"] [[call]] [[BIS_fnc_addStackedEventHandler]]; | ||
</code> | </code> | ||
Return FIRE: [something], VIEW: [something], GEOM: [something], IFIRE: [something]. | Return FIRE: [something], VIEW: [something], GEOM: [something], IFIRE: [something]. | ||
}} | |||
{{Note | |||
|user= Killzone_Kid | |||
|timestamp= 20150820183400 | |||
|text= [[intersect]] will spam .rpt if passed to it object has no skeleton. Use [[getModelInfo]] to filter out those objects. | |||
[[intersect]] will spam .rpt if passed to it object has no skeleton. Use [[getModelInfo]] to filter out those objects. | }} | ||
Revision as of 06:05, 30 October 2021
Description
- Description:
- Finds named selections in object which are in specified LOD, intersected by given section of a line. Return value is in the form of [selection, distance]. Multiple returned arrays are nested within a single array. No intersection returns []. lodName could be one of the following:
- "FIRE"
- "VIEW"
- "GEOM"
- "IFIRE" - ("I" stands for Indirect, almost the same as FIRE)
- 2.02 "PHYSX" - PhysX geometry LOD
- Groups:
- Math - Geometry
Syntax
- Syntax:
- [object, lodName] intersect [begPos, endPos]
- Parameters:
- [object, lodName]: Array
- object: Object
- lodName: String
- [begPos, endPos] : Array
- begPos: Array - format PositionAGL
- endPos: Array - format PositionAGL
- Return Value:
- Array - array of intersections in format: [[selection, distance],...], where
- selection - name of intersected selection
- distance - distance from begPos
Examples
- Example 1:
[_tank, "VIEW"] intersect [[1500, 1500, 2], [1550, 1500, 2]];
- Example 2:
sphere = "Sign_Sphere10cm_F" createVehicle [0,0,0]; onEachFrame { _begPos = positionCameraToWorld [0,0,0]; _begPosASL = AGLToASL _begPos; _endPos = positionCameraToWorld [0,0,1000]; _endPosASL = AGLToASL _endPos; _ins = lineIntersectsSurfaces [_begPosASL, _endPosASL, player, objNull, true, 1, "FIRE", "NONE"]; if (_ins isEqualTo []) exitWith {sphere setPosASL [0,0,0]}; _ins select 0 params ["_pos", "_norm", "_obj", "_parent"]; if !(getModelInfo _parent select 2) exitWith {sphere setPosASL [0,0,0]}; _ins2 = [_parent, "FIRE"] intersect [_begPos, _endPos]; if (_ins2 isEqualTo []) exitWith {sphere setPosASL [0,0,0]}; _ins2 select 0 params ["_name", "_dist"]; _posASL = _begPosASL vectorAdd ((_begPosASL vectorFromTo _endPosASL) vectorMultiply _dist); drawIcon3D ["", [1,1,1,1], ASLToAGL _posASL, 0, 0, 0, _name, 1, 0.03, "PuristaMedium"]; sphere setPosASL _posASL; };
Additional Information
- See also:
- lineIntersectsSurfacesterrainIntersectterrainIntersectASLterrainIntersectAtASLlineIntersectslineIntersectsWithlineIntersectsObjscursorObjectcursorTargetcheckVisibility
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
- Posted on Jul 25, 2007 - 08:37 (UTC)
- The most common LOD is "FIRE", which identifies the most detailled hitbox used for ammunition.
- Posted on Mar 27, 2014 - 14:52 (UTC)
-
Example (In Arma 3 ver 1.14) display returned arrays on cursor entities:
Sto = []; Fn = { { Sto set [_foreachindex,[cursorTarget, _x] intersect [ASLToAGL eyePos player, screenToWorld [0.5,0.5]]]; } foreach ["FIRE", "VIEW", "GEOM", "IFIRE"]; hintSilent format ["FIRE: %1, VIEW: %2, GEOM: %3, IFIRE: %4",Sto select 0, Sto select 1, Sto select 2, Sto select 3]; }; ["sample_id", "onEachFrame", "Fn"] call BIS_fnc_addStackedEventHandler;
Return FIRE: [something], VIEW: [something], GEOM: [something], IFIRE: [something].
- Posted on Aug 20, 2015 - 18:34 (UTC)
- intersect will spam .rpt if passed to it object has no skeleton. Use getModelInfo to filter out those objects.
Categories:
- Scripting Commands
- Introduced with Armed Assault version 1.00
- ArmA: Armed Assault: New Scripting Commands
- ArmA: Armed Assault: Scripting Commands
- Arma 2: Scripting Commands
- Arma 2: Operation Arrowhead: Scripting Commands
- Take On Helicopters: Scripting Commands
- Arma 3: Scripting Commands
- Command Group: Math - Geometry