Page 1 of 1

Errors in some btAssert expressions

Posted: Tue Jul 24, 2012 1:10 pm
by RolandSt
Hello,

there are some incorrect assert expressions (wrong boolean logic) inside some Demos.

E.G. FractureDemo.cpp(275):
btAssert((!m_shootBoxShape || m_shootBoxShape->getShapeType() != INVALID_SHAPE_PROXYTYPE));
should be
btAssert((m_shootBoxShape && m_shootBoxShape->getShapeType() != INVALID_SHAPE_PROXYTYPE));

There is a similar expression in btRigidBody* DemoApplication::localCreateRigidBody:
btAssert((!shape || shape->getShapeType() != INVALID_SHAPE_PROXYTYPE));
should be
btAssert((shape && shape->getShapeType() != INVALID_SHAPE_PROXYTYPE));

...and other places.

You can show the error by setting the pointer to 0 (e.g. shape=0). The assertion won't come up.

BTW: What is the best way to report errors? I start using Bullet for a project.

Beside this error: I really appreciate Bullet Physics! Thanks to Erwin Coumans and all other contributers!

rolandSt