issue in org.jbox2d.collision.shapes.PolygonShape:
// Perform welding and copy vertices into local buffer.
val ps = if (vecPool != null)
vecPool[Settings.maxPolygonVertices]
else
arrayOfNulls<Vec2>(Settings.maxPolygonVertices)
var tempCount = 0
for (i in 0 until n) {
val v = verts[i]
var unique = true
for (j in 0 until tempCount) {
if (MathUtils.distanceSquared(v, ps[j]!!) < 0.5f * Settings.linearSlop) {
unique = false
break
}
}
if (unique) {
ps[tempCount++]!!.set(v)
}
ps will be an array of nulls. Unique is true in the first run, since tempCount is 0
example:
issue in org.jbox2d.collision.shapes.PolygonShape:
ps will be an array of nulls. Unique is true in the first run, since tempCount is 0