Why is a count of 3 or more for box2D's "ComputeCentroid" function a problem?
by Joe Williams · in Torque 2D Professional · 05/19/2013 (9:14 pm) · 2 replies
Background: I have a bunch of objects that have polygon and boxpolygon collision shapes. These objects are frequently connected via joints in a large structure.
While running my game, within a few minutes, I always get the b2Assert(count >= 3) assertion. I have no idea what's causing this, but everything is fine if I ignore it. Is there any reason that I can't just comment it out? What if I up the limit?
While running my game, within a few minutes, I always get the b2Assert(count >= 3) assertion. I have no idea what's causing this, but everything is fine if I ignore it. Is there any reason that I can't just comment it out? What if I up the limit?
About the author
#2
05/20/2013 (4:15 pm)
The less than one world unit thing would make sense. I have small flame objects that have a collision polygon for physics purposes, but then their collision suppress is set to true. I'll make their polygons one world unit (since it really doesn't matter for my game) and see if that fixes it.
Associate Simon Love
Pretty sure it happenned in b2PolygonShape.
We will have to narrow it down with thorough debug sessions.
One useful trick would be to run the debug build and break when the error occurs and see what the previous engine calls were. That way we can figure out if it's due to collision, joints or whatever might be the cause.