每个多边形都有一个额外的小“半径”,在文档中进行了描述:
/**
* The radius of the polygon/edge shape skin. This should not be modified.
* Making this smaller means polygons will have and insufficient for
* continuous collision. Making it larger may create artifacts for vertex
* collision.
*/
public static float polygonRadius = (2.0f * linearSlop);
其中使用linearSlop,定义:
/**
* A small length used as a collision and constraint tolerance. Usually it
* is chosen to be numerically significant, but visually insignificant.
*/
public static float linearSlop = 0.005f;
所以这意味着你会想要
- 增加您的图纸尺寸以适应这一点,或
- 使您的坐标系更大,因此该空间 (0.02) 不明显。
我建议第二个。如果您的坐标系太小(或太大),它可能会产生其他性能影响。