힌지 조인트
리지드바디

메시 콜라이더

The Mesh Collider takes a Mesh Asset and builds its Collider based on that Mesh. It is more accurate for collision detection than using primitives for complicated Meshes. Mesh Colliders that are marked as Convex can collide with other Mesh Colliders.

프로퍼티

프로퍼티 기능
Convex Enable the checkbox to make the Mesh Collider collide with other Mesh Colliders. Convex Mesh Colliders are limited to 255 triangles.
Is Trigger Enable this checkbox to make Unity use this Collider for triggering events, and the physics engine ignore it.
Cooking Options 메시 쿠킹 옵션을 활성화하거나 비활성화하면 물리 엔진이 메시를 처리하는 방식에 영향을 줍니다.
None 아래에 나열된 Cooking Options 를 모두 비활성화합니다.
Everything 아래에 나열된 Cooking Options 를 모두 활성화합니다.
Cook for Faster Simulation 빠른 시뮬레이션을 위해 물리 엔진이 메시를 쿠킹하도록 만듭니다. 활성화하면 몇 가지 추가 단계를 실행하여 생성되는 메시를 런타임 성능에 최적화합니다. 이 작업은 물리 쿼리와 컨택트 생성에 영향을 미칩니다. 이 설정을 비활성화하면 물리 엔진이 빠른 쿠킹 타임을 사용하여 가능한 빠르게 결과물을 생성합니다. 따라서 쿠킹된 메시 콜라이더가 최적화되지 않을 수 있습니다.
Enable Mesh Cleaning Makes the physics engine clean Meshes. When enabled, the cooking process tries to eliminate degenerate triangles of the Mesh, as well as other geometrical artifacts. This results in a Mesh that is better suited for use in collision detection and tends to produce more accurate hit points.
Weld Colocated Vertices 물리 엔진이 메시에서 같은 버텍스를 삭제하도록 만듭니다. 활성화하면 물리 엔진이 동일한 포지션을 가진 버텍스를 결합합니다. 이 작업은 런타임 시점에 발생하는 충돌 피드백에 특히 중요합니다
Material 콜라이더가 다른 콜라이더와 상호작용하는 방법을 결정하는 물리 머티리얼에 대한 레퍼런스입니다.
Mesh 충돌에 사용할 메시에 대한 레퍼런스입니다.

세부 정보

The Mesh Collider builds its collision representation from the Mesh attached to the GameObject, and reads the properties of the attached Transform to set its position and scale correctly. The benefit of this is that you can make the shape of the Collider exactly the same as the shape of the visible Mesh for the GameObject, which creates more precise and authentic collisions. However, this precision comes with a higher processing overhead than collisions involving primitive colliders (such as Sphere, Box, and Capsule), so it is best to use Mesh Colliders sparingly.

Faces in collision meshes are one-sided. This means GameObjects can pass through them from one direction, but collide with them from the other.

Details about underlying algorithms and data structures used by mesh colliders can be found at PhysX documentation.

메시 쿠킹

Mesh cooking changes a normal Mesh into a Mesh that you can use in the physics engine. Cooking builds the spatial search structures for the physics queries, such as Physics.Raycast, as well as supporting structures for the contacts generation. Unity cooks all Meshes before using them in collision detection. This can happen at import time (Import Settings > Model > Generate Colliders) or at run time.

When you generate Meshes at run time (for example, for procedural surfaces), it’s useful to set the Cooking Options to produce results faster, and disable the additional data cleaning steps of cleaning. The downside is that you need to generate no degenerate triangles and no co-located vertices, but the cooking works faster.

If you disable Enable Mesh Cleaning or Weld Colocated Vertices, you need to ensure you aren’t using data that those algorithms would otherwise filter. Make sure you don’t have any co-located vertices if you have disabled Weld Colocated Vertices, and when you enable Enable Mesh Cleaning, make sure there are no tiny triangles whose area is close to zero, no thin triangles, and no huge triangles whose area is close to infinity.

Note: When you set the Cooking Options to any other value than the default settings, it means the Mesh Collider must use a Mesh that has an isReadable value of true.

제한 사항

메시 콜라이더 사용 시 다음과 같은 몇 가지 제약이 있습니다.

GameObjects that have a Rigidbody component only support Mesh Colliders that have Convex option enabled: the physics engine can only simulate convex mesh colliders.

메시 콜라이더가 제대로 동작하려면 다음과 같은 상황에서 메시의 읽기/쓰기가 가능해야 합니다.

  • The Mesh Collider’s Transform has negative scaling (for example, (–1, 1, 1)) and the Mesh is convex.
  • The Mesh Collider’s transform is skewed or sheared (for example, when a rotated transform has a scaled parent transform).
  • The Mesh Collider’s Cooking Options flags are set to any value other than the default.

You should not modify mesh geometry that is used for colliders because the physics engine has to rebuild an internal mesh collision acceleration structure every time you change the mesh. This causes a substantial performance overhead. For meshes that need to collide and change at runtime, it is often better to approximate the mesh shape with primitive colliders like capsules, spheres and boxes.

Optimization tip: If a Mesh Collider only uses a Mesh, you can disable Normals in Import Settings, because the physics system doesn’t need them.


  • 2018.3에서 메시 콜라이더 제한 사항 업데이트됨

  • 2018–10–12 Page amended

  • Unity 2017.3에서 메시 쿠킹 옵션 추가됨 NewIn20173

  • 2018.1에서 업데이트된 기능

  • 2017.3에서 읽기/쓰기 활성화 설정과 관련된 제한 사항 업데이트됨

  • 볼록한 메시 팽창은 2018.3에서 지원이 중단되었습니다. 이는 새로운 볼록 헐 계산 알고리즘(Quickhull)이 입력 메시의 결함에 대해 더 큰 허용치를 제공하기 때문입니다.

힌지 조인트
리지드바디