Assert error during simulation step

Post Reply
rebirth
Posts: 24
Joined: Thu Jul 24, 2014 2:48 am

Assert error during simulation step

Post by rebirth »

Somewhere during the step simulation call I am getting a triggered breakpoint in the btAlignedObjectArray.h file.

Here:

Code: Select all

SIMD_FORCE_INLINE T& operator[](int n)
		{
			btAssert(n>=0);
			btAssert(n<size());
			return m_data[n];
		}
n = -1;

This only happens in DEBUG build on vs2015 compiling x64. It works OK in Release build but I guess that's because btAssert() isn't called on Release build.
I only have a BVH mesh and a basic kinematic ghost object. The crash happens the moment these two things collide.

The kinematic object inherits btActionInterface.

Any suggestions?
S1L3nCe
Posts: 50
Joined: Thu Mar 24, 2016 10:22 am
Location: France

Re: Assert error during simulation step

Post by S1L3nCe »

Hi,

Yes, assert are triggered only in Debug mode.

For your problem, you just should check the callstack when visual trigger the assert, it will bring you at the wrong call in the code.
Then we'll see what is the problem.
rebirth
Posts: 24
Joined: Thu Jul 24, 2014 2:48 am

Re: Assert error during simulation step

Post by rebirth »

Thanks, but the callstack wasn't giving me much information that I could interpret as something useful, other than to help me figure out when the crash happened.

However, some of the sourcecode I am using I wrote a while ago for 32 bit builds, and after changing the following this assert has stopped happening:

From this:
pGhostObject->setCollisionFlags(btCollisionObject::CF_CHARACTER_OBJECT);

To this:
pGhostObject->setCollisionFlags(pGhostObject->getCollisionFlags() | btCollisionObject::CF_CHARACTER_OBJECT);

This stops the crash, but for some reason bullet is throwing a warning: btCollisionDispatcher::needsCollision: static-static collision!

Since I only have one static and one character_object in the world then this doesn't make much sense.
Post Reply