mirat
Posts: 16 Joined: Thu May 29, 2008 10:47 am
Post
by mirat » Tue Jun 17, 2008 9:29 am
src/BulletCollision/NarrowPhaseCollision/btPersistentManifold.cpp
bullet 2.68
Code: Select all
void btPersistentManifold::AddManifoldPoint(const btManifoldPoint& newPoint)
{
assert(validContactDistance(newPoint));
int insertIndex = getNumContacts();
if (insertIndex == MANIFOLD_CACHE_SIZE)
{
#if MANIFOLD_CACHE_SIZE >= 4
//sort cache so best points come first, based on area
insertIndex = sortCachedPoints(newPoint);
#else
insertIndex = 0;
#endif
} else
{
m_cachedPoints++;
}
replaceContactPoint(newPoint,insertIndex);
}
bullet 2.69
Code: Select all
void btPersistentManifold::AddManifoldPoint(const btManifoldPoint& newPoint)
{
assert(validContactDistance(newPoint));
int insertIndex = getNumContacts();
if (insertIndex == MANIFOLD_CACHE_SIZE)
{
#if MANIFOLD_CACHE_SIZE >= 4
//sort cache so best points come first, based on area
insertIndex = sortCachedPoints(newPoint);
#else
insertIndex = 0;
#endif
} else
{
m_cachedPoints++;
}
btAssert(m_pointCache[insertIndex].m_userPersistentData==0);
m_pointCache[insertIndex] = newPoint;
}
When the number of points exceeded the limit, old bullet just reused the worst points and replaced it. I ported my app to use a new bullet and I'm getting this assert when two cubes collides by their sides. What should I do?
Erwin Coumans
Site Admin
Posts: 4221 Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Post
by Erwin Coumans » Tue Jun 17, 2008 10:41 am
This is probably an issue I introduced accidently, so it will need to be fixed.
Thanks a lot for reporting, we'll fix it for Bullet 2.70,
Erwin
Wavesonics
Posts: 71 Joined: Thu May 22, 2008 8:03 pm
Post
by Wavesonics » Tue Jun 17, 2008 7:13 pm
Yes, this is one of the problems I ran into with the contact destroyed callbacks, that kept firing off.
Good to hear it will be fixed.
Erwin Coumans
Site Admin
Posts: 4221 Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Post
by Erwin Coumans » Sun Jun 22, 2008 3:04 am
Please add a 'clearUserCache' so the implementation becomes:
Code: Select all
void btPersistentManifold::AddManifoldPoint(const btManifoldPoint& newPoint)
{
assert(validContactDistance(newPoint));
int insertIndex = getNumContacts();
if (insertIndex == MANIFOLD_CACHE_SIZE)
{
#if MANIFOLD_CACHE_SIZE >= 4
//sort cache so best points come first, based on area
insertIndex = sortCachedPoints(newPoint);
#else
insertIndex = 0;
#endif
clearUserCache(m_pointCache[insertIndex]);
} else
{
m_cachedPoints++;
}
btAssert(m_pointCache[insertIndex].m_userPersistentData==0);
m_pointCache[insertIndex] = newPoint;
}
You can also use the latest Bullet subversion trunk from googlecode, the fix and some related fixes have been applied.
Can you report if this fixes the issue? Thanks,
Erwin
mirat
Posts: 16 Joined: Thu May 29, 2008 10:47 am
Post
by mirat » Tue Jun 24, 2008 6:54 am
It seems that adding clearUserCache fixes the problem, thanks.