我使用PhysicsEditor工具导出box2d的复合形状。我已经对我能想到的一切进行了第二次检查 - 但碰撞形状比精灵形状大几倍。
ptm_ratio值是正确的,加载这些GB2ShapeCache的类正在将ptm_ratio
正确应用于顶点坐标,我已经将锚点设置为中间,就像cocos2d一样
无论ptm比率是多少,边界框通常都是精灵的几倍。好像精灵大小乘以5.我已经尝试了两个不同的精灵,我看到了相同的结果。
有什么想法吗?
<key>asteroid-small</key>
<dict>
<key>anchorpoint</key>
<string>{ 0.5000,0.5000 }</string>
<key>fixtures</key>
<array>
<dict>
<key>density</key> <real>10</real>
<key>friction</key> <real>0.1</real>
<key>restitution</key> <real>0.1</real>
<key>filter_categoryBits</key> <integer>1</integer>
<key>filter_groupIndex</key> <integer>0</integer>
<key>filter_maskBits</key> <integer>65535</integer>
<key>isSensor</key> <false/>
<key>id</key> <string></string>
<key>fixture_type</key> <string>POLYGON</string>
<key>polygons</key>
<array>
<array>
<string>{ -13.000,10.500 }</string>
<string>{ -14.000,5.500 }</string>
<string>{ -13.000,-6.500 }</string>
<string>{ 7.000,-13.500 }</string>
<string>{ 16.000,-5.500 }</string>
<string>{ 16.000,2.500 }</string>
<string>{ 10.000,13.500 }</string>
<string>{ -3.000,12.500 }</string>
</array>
<array>
<string>{ -8.000,-17.500 }</string>
<string>{ -2.000,-17.500 }</string>
<string>{ 7.000,-13.500 }</string>
<string>{ -13.000,-6.500 }</string>
<string>{ -13.000,-12.500 }</string>
</array>
<array>
<string>{ 1.000,17.500 }</string>
<string>{ -3.000,12.500 }</string>
<string>{ 10.000,13.500 }</string>
<string>{ 5.000,17.500 }</string>
</array>
<array>
<string>{ -13.000,-6.500 }</string>
<string>{ -14.000,5.500 }</string>
<string>{ -16.000,3.500 }</string>
<string>{ -16.000,-1.500 }</string>
</array>
</array>
</dict>