bullet 2.79 double precision

Granyte
Posts: 77
Joined: Tue Dec 27, 2011 11:51 am

bullet 2.79 double precision

Post by Granyte »

ok so i rebuilt bullet 2.79 with double precision and naturaly i bumped my head against a wall when i linked the new library with my project that works fine with bullet 2.78 bang linking error

Code: Select all

LINK : warning LNK4098: defaultlib 'LIBCMT' conflicts with use of other libs; use /NODEFAULTLIB:library
1>CelestialBody.obj : error LNK2001: unresolved external symbol "public: virtual float __thiscall btCollisionShape::getContactBreakingThreshold(float)const " (?getContactBreakingThreshold@btCollisionShape@@UBEMM@Z)
1>CelestialBody.obj : error LNK2001: unresolved external symbol "public: virtual float __thiscall btCollisionShape::getAngularMotionDisc(void)const " (?getAngularMotionDisc@btCollisionShape@@UBEMXZ)
1>CelestialBody.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btCollisionShape::getBoundingSphere(class btVector3 &,float &)const " (?getBoundingSphere@btCollisionShape@@UBEXAAVbtVector3@@AAM@Z)
1>CelestialBody.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall btSphereShape::calculateLocalInertia(float,class btVector3 &)const " (?calculateLocalInertia@btSphereShape@@UBEXMAAVbtVector3@@@Z)
1>CelestialBody.obj : error LNK2001: unresolved external symbol "public: __thiscall btRigidBody::btRigidBody(float,class btMotionState *,class btCollisionShape *,class btVector3 const &)" (??0btRigidBody@@QAE@MPAVbtMotionState@@PAVbtCollisionShape@@ABVbtVector3@@@Z)
1>E:\Users\David\Documents\Visual Studio 2010\Projects\outerspace3\Release\OuterSpaceClient.exe : fatal error LNK1120: 5 unresolved externals

so after now nearly a month of bumping my head against a wall i looked at the bullet source

when i look at it from the bullet source solution

Code: Select all

#if defined(BT_USE_DOUBLE_PRECISION)
typedef double btScalar;
//this number could be bigger in double precision
#define BT_LARGE_FLOAT 1e30
the double precision mode is engaged

but when i look at it from my project file no avail

Code: Select all

#if defined(BT_USE_DOUBLE_PRECISION)
typedef float btScalar;
//keep BT_LARGE_FLOAT*BT_LARGE_FLOAT < FLT_MAX
#define BT_LARGE_FLOAT 1e18f
#endif
it's still in single precision mode so after a though i looked to see if i could find where BT_USE_DOUBLE_PRECISION is defined and no avail it's not working

so how do i get this to work it makes absolutly no sence for me what am i doing wrong
Granyte
Posts: 77
Joined: Tue Dec 27, 2011 11:51 am

Re: bullet 2.79 double precision

Post by Granyte »

just to make sure i tested and in single precision mode i can upgrade to bullet 2.79 with no issue so how come it won't work moving from single precision to double precision
Karrok
Posts: 65
Joined: Fri May 13, 2011 1:11 pm

Re: bullet 2.79 double precision

Post by Karrok »

If you build bullet in double precision you have to make sure that you have:

BT_USE_DOUBLE_PRECISION in your Preprocessor Definitions (project properties -> C/C++ -> preprocessor)
Granyte
Posts: 77
Joined: Tue Dec 27, 2011 11:51 am

Re: bullet 2.79 double precision

Post by Granyte »

thank alot that finaly resolved my issue
ThinCrust
Posts: 4
Joined: Sun Dec 15, 2013 2:24 pm

Re: bullet 2.79 double precision

Post by ThinCrust »

I was reading this thread before I found my solution for VS2010 using Bullet 2.82, and wanted to add that double precision worked for me when I added equals 1 in the Preprocessor definitions, so:

Code: Select all

BT_USE_DOUBLE_PRECISION=1
Perhaps it's my C++ n00bness (implicitly meaning to always add a value even though it is not mentioned in the Bullet manual) or due to some environment configuration setting, but setting the above worked when it was added to both the LinearMath debug and release solutions and my project that included the Bullet libs.