Fandom

武装突袭 Wiki

LineIntersectsSurfaces

简体 | 繁體

4,827个页面创建
于此维基上
添加新页面
评论0 Share

您使用了广告屏蔽软件!


Wikia通过广告运营为用户提供免费的服务。我们对用户通过嵌入广告屏蔽软件访问网站进行了使用调整。

如果您使用了广告屏蔽软件,将无法使用我们的服务。请您移除广告屏蔽软件,以确保页面正常加载。

Introduced with Arma 3 version 1.50
  Arguments of this scripting command don't have to be local to the client the command is executed on

点击图片可看到更多讯息

开始使用于

游戏:
Arma 3
版本:
1.50

描述

描述:
Returns list of intersections with surfaces from begPosASL to endPosASL. If there is ground intersection, it is also included. Works on units. Works underwater. Doesn't return intersection with sea surface. Hardcoded max distance: 5000m.

Since Arma v1.51.131920 it is possible to indicate primary and secondary LOD to look for intersection. Available options are:

  • "FIRE"
  • "VIEW"
  • "GEOM"
  • "IFIRE" - ("I" stands for Indirect, almost the same as FIRE)
  • "NONE"

Default LODs are "VIEW" and "FIRE"

基本句法

句法:
lineIntersectsSurfaces [begPosASL, endPosASL, ignoreObj1, ignoreObj2, sortMode, maxResults, LOD1, LOD2]
参数:
[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

LOD1 (Optional): String (added in v1.51.131920) - Primary LOD to look for intersection. Default: "VIEW"

LOD2 (Optional): String (added in v1.51.131920) - Secondary LOD to look for intersection. Default: "FIRE"
返回值:
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)
  • parentObject - the object proxy object belongs to (not always the same as intersect object)

范例

范例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:
This should detect glass windows and wire fences (since 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; };

额外资讯

多人游戏:
-
也可以看看:

lineIntersectsWithlineIntersectsObjsterrainIntersectterrainIntersectASLlineIntersectsintersectcursorObjectcursorTarget

注意事项

此处撰写句法皆为可行用法. 可到官网[1]专页回报错误. 你可以使用讨论页面或是论坛来进行讨论.
新增注意事项 | 如何新增?

Notes

Bottom Section

Posted on August 27, 2015 - 12:44 (UTC)
Killzone Kid
Fast check if object is in a house:KK_fnc_inHouse = { lineIntersectsSurfaces [ getPosWorld _this, getPosWorld _this vectorAdd [0, 0, 50], _this, objNull, true, 1, "GEOM", "NONE" ] select 0 params ["","","","_house"]; if (_house isKindOf "House") exitWith {true}; false }; onEachFrame {hintSilent str (player call KK_fnc_inHouse)};

Posted on January 30, 2016 - 20:10 (UTC)
Pierre MGI
This command is useful to place weaponholder (and then spawned weapons) on floor of houses, correcting the spawn position (can_collide) to intersect with floor: MGI_fnc_setPosAGLS = {

 params ["_obj", "_pos"];
 _wh_pos = getPosASL _obj;
 _pos set [2, (ATLToASL _pos select 2)-10];

_ins = lineIntersectsSurfaces [_wh_pos, _pos,_obj,objNull, true,1,"VIEW","FIRE"]; _surface_distance = if (count _ins > 0) then [{(_ins select 0 select 0) distance _wh_pos},{0}]; _wh_pos set [2, (getPosASL _obj select 2) - (_surface_distance)]; _weaponholder setPosASL _wh_pos; }; After the position (_pos) obtained in BIS_fnc_buidingPositions array: _weaponholder = createVehicle ["groundWeaponHolder", _pos, [], 0, "CAN_COLLIDE"]; [_weaponholder,_pos] call MGI_fnc_setPosAGLS; Then fill your weapon holder.


更多维基

随机维基