I was having having problems with high speed objects, and as the CCD code seemed stable enough now, I decided to update my svn copy (I'm in rev. 69 right now) and started to get a weird error (keep in mind that I'm developing for the iPhone, so I have no SDK and no debugger...).
After a lot of time trying to find out what was happening, and adding a lot of debug info to my program, I got this:
Entity::posStep new position: (190.123322, 60.345886)
Collision/b2Distance.cpp:89: failed assertion `(sn > 0.0f || tn > 0.0f)'
Collision/b2Distance.cpp:90: failed assertion `(sd > 0.0f || un > 0.0f)'
Collision/b2Distance.cpp:96: failed assertion `(vc > 0.0f || sn > 0.0f || sd > 0.0f)'
Collision/b2Distance.cpp:128: failed assertion `(denom > 0.0f)'
Entity::posStep old position: (190.123322, 60.345886)
Entity::posStep new position: (190.554840, 60.660576)
Collision/b2Distance.cpp:89: failed assertion `(sn > 0.0f || tn > 0.0f)'
Collision/b2Distance.cpp:90: failed assertion `(sd > 0.0f || un > 0.0f)'
Collision/b2Distance.cpp:96: failed assertion `(vc > 0.0f || sn > 0.0f || sd > 0.0f)'
Collision/b2Distance.cpp:128: failed assertion `(denom > 0.0f)'
Dynamics/Contacts/b2ContactSolver.cpp:94: failed assertion `(kNormal > 1.19209290e-7F)'
Dynamics/Contacts/b2ContactSolver.cpp:103: failed assertion `(kTangent > 1.19209290e-7F)'
Entity::posStep old position: (190.554840, 60.660576)
Entity::posStep new position: (nan, nan)
Dynamics/Contacts/b2ContactSolver.cpp:94: failed assertion `(kNormal > 1.19209290e-7F)'
Dynamics/Contacts/b2ContactSolver.cpp:103: failed assertion `(kTangent > 1.19209290e-7F)'
2007-12-17 00:29:41.121 iPhysics[606:d03] Crayongame::notifyBoundaryViolated
2007-12-17 00:29:41.125 iPhysics[606:d03] body.m_flags=86
2007-12-17 00:29:41.128 iPhysics[606:d03] body.m_position=(nan, nan)
2007-12-17 00:29:41.132 iPhysics[606:d03] body.m_rotation=nan
2007-12-17 00:29:41.136 iPhysics[606:d03] body.m_linearVelocity=(0.000000, 0.000000)
2007-12-17 00:29:41.141 iPhysics[606:d03] body.m_angularVelocity=0.000000
2007-12-17 00:29:41.143 iPhysics[606:d03] body.m_force=(0.000000, 0.000000)
2007-12-17 00:29:41.146 iPhysics[606:d03] body.m_torque=0.000000
2007-12-17 00:29:41.149 iPhysics[606:d03] body.m_center=(0.000000, 0.000000)
2007-12-17 00:29:41.151 iPhysics[606:d03] body.m_shapeCount=1
2007-12-17 00:29:41.153 iPhysics[606:d03] body.m_mass=76.969025
2007-12-17 00:29:41.155 iPhysics[606:d03] body.m_invMass=0.012992
2007-12-17 00:29:41.162 iPhysics[606:d03] body.m_I=1885.741211
2007-12-17 00:29:41.167 iPhysics[606:d03] body.m_invI=0.000530
I added the bold where I think the problem lies... I tried to look at the code that is failing the assertion, but couldn't figure out exactly what it's doing, so I'm kind of lost now...
Is this something I'm doing wrong? Is there any more data I can collect to help solve this problem?
Also, almost all collisions are getting that b2Distance.cpp asserts, I imagine this shouldn't be happening?
After a lot of time trying to find out what was happening, and adding a lot of debug info to my program, I got this:
Entity::posStep new position: (190.123322, 60.345886)
Collision/b2Distance.cpp:89: failed assertion `(sn > 0.0f || tn > 0.0f)'
Collision/b2Distance.cpp:90: failed assertion `(sd > 0.0f || un > 0.0f)'
Collision/b2Distance.cpp:96: failed assertion `(vc > 0.0f || sn > 0.0f || sd > 0.0f)'
Collision/b2Distance.cpp:128: failed assertion `(denom > 0.0f)'
Entity::posStep old position: (190.123322, 60.345886)
Entity::posStep new position: (190.554840, 60.660576)
Collision/b2Distance.cpp:89: failed assertion `(sn > 0.0f || tn > 0.0f)'
Collision/b2Distance.cpp:90: failed assertion `(sd > 0.0f || un > 0.0f)'
Collision/b2Distance.cpp:96: failed assertion `(vc > 0.0f || sn > 0.0f || sd > 0.0f)'
Collision/b2Distance.cpp:128: failed assertion `(denom > 0.0f)'
Dynamics/Contacts/b2ContactSolver.cpp:94: failed assertion `(kNormal > 1.19209290e-7F)'
Dynamics/Contacts/b2ContactSolver.cpp:103: failed assertion `(kTangent > 1.19209290e-7F)'
Entity::posStep old position: (190.554840, 60.660576)
Entity::posStep new position: (nan, nan)
Dynamics/Contacts/b2ContactSolver.cpp:94: failed assertion `(kNormal > 1.19209290e-7F)'
Dynamics/Contacts/b2ContactSolver.cpp:103: failed assertion `(kTangent > 1.19209290e-7F)'
2007-12-17 00:29:41.121 iPhysics[606:d03] Crayongame::notifyBoundaryViolated
2007-12-17 00:29:41.125 iPhysics[606:d03] body.m_flags=86
2007-12-17 00:29:41.128 iPhysics[606:d03] body.m_position=(nan, nan)
2007-12-17 00:29:41.132 iPhysics[606:d03] body.m_rotation=nan
2007-12-17 00:29:41.136 iPhysics[606:d03] body.m_linearVelocity=(0.000000, 0.000000)
2007-12-17 00:29:41.141 iPhysics[606:d03] body.m_angularVelocity=0.000000
2007-12-17 00:29:41.143 iPhysics[606:d03] body.m_force=(0.000000, 0.000000)
2007-12-17 00:29:41.146 iPhysics[606:d03] body.m_torque=0.000000
2007-12-17 00:29:41.149 iPhysics[606:d03] body.m_center=(0.000000, 0.000000)
2007-12-17 00:29:41.151 iPhysics[606:d03] body.m_shapeCount=1
2007-12-17 00:29:41.153 iPhysics[606:d03] body.m_mass=76.969025
2007-12-17 00:29:41.155 iPhysics[606:d03] body.m_invMass=0.012992
2007-12-17 00:29:41.162 iPhysics[606:d03] body.m_I=1885.741211
2007-12-17 00:29:41.167 iPhysics[606:d03] body.m_invI=0.000530
I added the bold where I think the problem lies... I tried to look at the code that is failing the assertion, but couldn't figure out exactly what it's doing, so I'm kind of lost now...
Is this something I'm doing wrong? Is there any more data I can collect to help solve this problem?
Also, almost all collisions are getting that b2Distance.cpp asserts, I imagine this shouldn't be happening?