2Dphysics polygon collider. Concave polygons are currently not supported. If it is a concave polygon, manually split it into multiple convex polygons first. The maximum number of vertices is b2_maxPolygonVertices, which defaults to 8. So it is not recommended to exceed 8 points, and it cannot be less than 3.

2D物理多边形碰撞体,暂时不支持凹多边形,如果是凹多边形,先手动拆分为多个凸多边形。 节点个数最多是 b2_maxPolygonVertices,这数值默认是8,所以点的数量不建议超过8个,也不能小于3个。

层级 (查看完整内容)

构造函数

访问器

  • get density(): number
  • 返回 number

    The density value. The value can be zero or a positive number. It is recommended to use similar densities to improve stacking stability. The default value is 10.

    密度值。值可以为零或者是正数,建议使用相似的密度以改善堆叠稳定性。默认值为 10。

  • set density(value): void
  • 参数

    • value: number

    返回 void

  • get restitutionThreshold(): number
  • 返回 number

    Restitution velocity threshold, usually in meters per second. Collisions above this velocity will have restitution applied (will bounce).

    恢复速度阈值,通常以米/秒为单位。高于此速度的碰撞将应用恢复(将反弹)。

  • set restitutionThreshold(value): void
  • 参数

    • value: number

    返回 void

方法