首页阅读

ARMA3lineIntersectsSurfaces命令

ARMA3lineIntersectsSurfaces命令

返回从begPosASL到endPosASL的曲面的相交列表。如果有地面交叉点,则也包括在内。适用于单位。在水下工作。不返回与海面的交叉点。硬编码的最大距离:5000m。默认情况下,出于速度目的,命令将仅返回与唯一对象的第一个交集。从Arma 3 v1.69.140138开始,可以使用可选参数对其进行调整。

句法:

lineIntersectsSurfaces [begPosASL,endPosASL,ignoreObj1,ignoreObj2,sortMode,maxResults,LOD1,LOD2,returnUnique]

参数:

[begPosASL,endPosASL,ignoreObj1,ignoreObj2,sortMode,maxResults,LOD1,LOD2]:数组

begPosASL:PositionASL-虚拟行开始

endPosASL:PositionASL-虚拟线末端

ignoreObj1(可选):对象 -要忽略的第一个对象或objNull:默认值:objNull

ignoreObj2(可选):对象 -要忽略的第二个对象或objNull:默认值:objNull

sortMode(可选):布尔 - 真:最接近最远,假:最远最接近。默认值:true

maxResults(可选):数字 -要返回的最大结果。-1返回每个结果。默认值:1

LOD1(可选):字符串(在v1.51.131920中添加)- 用于查找交集的主LOD。默认视图”

LOD2(可选):字符串(在v1.51.131920中添加)- 用于查找相交的辅助LOD。默认值:“ FIRE”

returnUnique(可选):布尔值(在v1.69.140138中添加)-为false时,将包括同一对象中的所有交集,而不仅仅是第一个。默认值:true

返回值:

阵列在格式交点[[intersectPosASL,surfaceNormal,intersectObj,parentObject],...],其中的:

intersectPosASL-线与曲面相交的实际位置

surfaceNormal-相交表面的法线

intersectObject-曲面所属的对象(可以是代理对象)- 地形时为objNull

parentObject-对象代理对象所属(并不总是与相交对象相同)-地形时为objNull

范例1:

_intersections = lineIntersectsSurfaces [eyePos player, aimPos chopper, player, chopper, true, -1];

范例2:

arrow = Sign_Arrow_F createVehicle [0,0,0];onEachFrame {_ins = lineIntersectsSurfaces [AGLToASL positionCameraToWorld [0,0,0], AGLToASL positionCameraToWorld [0,0,1000], player];if (count _ins == 0) exitWith {arrow setPosASL [0,0,0]};arrow setPosASL (_ins select 0 select 0); arrow setVectorUp (_ins select 0 select 1);hintSilent str _ins;};

范例3:

这应该检测到玻璃窗和铁丝网(自Arma v1.51.131920起):wirefence = Land_New_WiredFence_5m_F createVehicle position player;arrow = Sign_Arrow_F createVehicle [0,0,0];onEachFrame {_ins = lineIntersectsSurfaces [AGLToASL positionCameraToWorld [0,0,0], AGLToASL positionCameraToWorld [0,0,1000], player,objNull,true,1,GEOM,NONE];if (count _ins == 0) exitWith {arrow setPosASL [0,0,0]};arrow setPosASL (_ins select 0 select 0); arrow setVectorUp (_ins select 0 select 1);hintSilent str _ins;};

以上就是(ARMA3lineIntersectsSurfaces命令)全部内容,收藏起来下次访问不迷路!

86%的人还看了:求人也是一门学问