I determined that some were related to drawing polygons wrong (as in not listing the coordinates in a counter clockwise fashion).
but I still frequently get this: This is the chunk that its refering to:
Code: Select all
205 // Create core polygon shape by shifting edges inward.
206 // Also compute the min/max radius for CCD.
207 for (int32 i = 0; i < m_vertexCount; ++i)
208 {
209 int32 i1 = i - 1 >= 0 ? i - 1 : m_vertexCount - 1;
210 int32 i2 = i;
211
212 b2Vec2 n1 = m_normals[i1];
213 b2Vec2 n2 = m_normals[i2];
214 b2Vec2 v = m_vertices[i] - m_centroid;;
215
216 b2Vec2 d;
217 d.x = b2Dot(n1, v) - b2_toiSlop;
218 d.y = b2Dot(n2, v) - b2_toiSlop;
219
220 // Shifting the edge inward by b2_toiSlop should
221 // not cause the plane to pass the centroid.
222
223 // Your shape has a radius/extent less than b2_toiSlop.
224 b2Assert(d.x >= 0.0f);
225 b2Assert(d.y >= 0.0f);
226 b2Mat22 A;
227 A.col1.x = n1.x; A.col2.x = n1.y;
228 A.col1.y = n2.x; A.col2.y = n2.y;
229 m_coreVertices[i] = A.Solve(d) + m_centroid;
230 }
231 }
Also on occasion I'm getting crashes that are attributed to random modules, not really sure whats causing them, but I wonder if it might be related.