文档

Unity Engine

Unity Engine

GetSeparation(int)

Get the separation value at a particular contact point in this contact pair.
阅读时间1 分钟最后更新于 1 个月前

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.PhysicsModule
public float GetSeparation(int i)

Parameters

Index of the contact point.

Returns

Type

Description

floatThe separation at a contact point.

Remarks

Separation shows the distance between the colliders at this contact point. Negative means the colliders overlap each other. Positive means the colliders are still separated.
Note that the physics engine starts generating contact pairs when the distance between is lower than the sum of their respective Collider.contactOffset.