Double Precision build errors

AlexSilverman
Posts: 141
Joined: Mon Jul 02, 2007 5:12 pm

Double Precision build errors

Post by AlexSilverman »

Hello,

I tried building Bullet 2.56 in the double precision configuration in Visual Studio 2005 (bullet-2.56\msvc\8\wksbullet.sln), and I got 2 distinct build errors. The first is because plReal is defined as a float in bullet-c-api.h, line 28. I fixed that with the following...

Code: Select all

#ifdef BT_USE_DOUBLE_PRECISION
typedef double	plReal;
#else
typedef float	plReal;
#endif
The next error is the following

Code: Select all

error C2782: 'const T &btMax(const T &,const T &)' : template parameter 'T' is ambiguous
at line 269 and 251 of btConeTwistConstraint.cpp.

I fixed that by changing

Code: Select all

m_accTwistLimitImpulse = btMax(m_accTwistLimitImpulse + impulseMag, 0.0f );
to

Code: Select all

m_accTwistLimitImpulse = btMax<btScalar>(m_accTwistLimitImpulse + impulseMag, 0.0f );
It now builds properly with no errors. I've done some very basic tests with the generated library, and my "fixes" don't seem to have boken anything in any fundamental way, but I thought I'd put this out and see what people had to say.

- Alex
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Double Precision build errors

Post by Erwin Coumans »

Thanks, this has been fixed based on your feedback,
Erwin