박스로 캐스팅을 하는 것이고 인자 중 maxDistance 를 보면 알 수 있듯이 박스를 최대 던지는 거리(캐스팅 거리)가 있다는 것을 알 수 있습니다
인자 중 layermask 마스크 인자는 캐스팅(픽킹) 하고 싶은 레이어만을 선택 할 수 있습니다
All 은 모든 충돌체 박스 캐스팅 충돌체에 의한
충돌 범위는 center + halfExtention ~ maxDistance + halfExtention 범위까지 체크됩니다
public static RaycastHit[] BoxCastAll(Vector3 center, Vector3 halfExtents, Vector3 direction, Quaternion orientation = Quaternion.identity, float maxDistance = Mathf.Infinity, int layerMask = DefaultRaycastLayers, QueryTriggerInteraction queryTriggerInteraction = QueryTriggerInteraction.UseGlobal);
Parameters
center | Center of the box. |
halfExtents | Half the size of the box in each dimension. |
direction | The direction in which to cast the box. |
orientation | Rotation of the box. |
maxDistance | The max length of the cast. |
layermask | A Layer mask that is used to selectively ignore colliders when casting a capsule. |
queryTriggerInteraction | Specifies whether this query should hit Triggers. |
Returns
RaycastHit[] All colliders that were hit.
Description
Like Physics.BoxCast, but returns all hits.
Notes: For colliders that overlap the box at the start of the sweep, RaycastHit.normal is set opposite to the direction of the sweep, RaycastHit.distance is set to zero, and the zero vector gets returned in RaycastHit.point. You might want to check whether this is the case in your particular query and perform additional queries to refine the result.
ref : https://docs.unity3d.com/ScriptReference/Physics.BoxCastAll.html
반응형
'게임엔진(GameEngine) > Unity3D' 카테고리의 다른 글
how to make a transparent color with CreatePrimitive (0) | 2018.10.08 |
---|---|
How do I make member structs accessible in the editor? (0) | 2018.10.08 |
How to get a List<> from GetComponents? (0) | 2018.10.07 |
Can Rigidbody 2D collide with 3D Colliders? (2D, 3D Collision) (0) | 2018.08.04 |
Box Collider 2D -failed verification- warning even when the size is reasonable (0) | 2018.08.04 |