I wondered about btQuaternion.h line 289: There it says:
Code: Select all
static const btQuaternion& getIdentity()
{
static const btQuaternion identityQuat(btScalar(0.),btScalar(0.),btScalar(0.),btScalar(1.));
return identityQuat;
}
Code: Select all
static const btQuaternion& getIdentity()
{
extern btQuaternion identityQuat;
return identityQuat;
}
Code: Select all
btQuaternion identityQuat (btScalar(0.),btScalar(0.),btScalar(0.),btScalar(1.));
For me, this is especially creating difficulties because my project is has some files with c++/clr support turned on and having statically created variables that have to be constructed in a header file included by .cpp file with and without clr support turned on creates some kind of race condition at the beginning of the program when all static variables get created.
I checked libbulletcollison, libbulletdynamics and libbulletmath and that seems to be the only place of this kind. I'm not 100% sure my reason is correct, but changing this line of code like above seems to solve my problem (20 successful starts in a row while otherwise it crashes imediately at elast once every 3 runs).