Building.txt 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. 0) Run "Clean.bat"
  2. 1) Run "build_visual_studio_without_pybullet_vr.bat"
  3. 2) Open "build3\vs2010\0_Bullet3Solution.sln"
  4. 3) Allow auto update to latest Platform Toolset
  5. 4) Select Projects "BulletCollision", "BulletDynamics", "LinearMath" and open their Properties
  6. 5) Set Platform Toolset to support Windows XP
  7. 6) General
  8. Output Directory - restore default
  9. Intermediate Directory - restore default
  10. C/C++
  11. General
  12. Debug Information Format - None
  13. Language
  14. Enable Run-Time Type Info - Yes
  15. 7) Create new Configuration: "Release Universal"
  16. Create new Platforms: Emscripten, x64, ARM
  17. For Release Universal ARM/Win32/x64 set:
  18. General \ Windows Store App Support = Yes
  19. General \ Platform Toolset = Visual Studio 2017 (v141) or newer
  20. General \ Windows SDK Version = 10...
  21. C/C++ \ General \ Consume Windows Runtime Extension = Yes (/ZW)
  22. C/C++ \ Code Generation \ Runtime Library = Multi-threaded DLL (/MD)
  23. For Emscripten, reset Target Extension, set Platform Toolset "emcc", remove all Clang Command Line options
  24. 8) Have to manually edit - C:\Esenthel\ThirdPartyLibs\Bullet\lib\build3\vs2010
  25. BulletCollision.vcxproj
  26. BulletDynamics.vcxproj
  27. LinearMath.vcxproj
  28. and Replace
  29. <WindowsAppContainer>true</WindowsAppContainer>
  30. with
  31. <WindowsAppContainer>true</WindowsAppContainer> <AppContainerApplication>true</AppContainerApplication>
  32. 9) Apply code changes:
  33. /******************************************************************************/
  34. In src\BulletDynamics\ConstraintSolver\btConeTwistConstraint.h
  35. Change
  36. const btTransform& getAFrame() { return m_rbAFrame; };
  37. const btTransform& getBFrame() { return m_rbBFrame; };
  38. To
  39. btTransform& getAFrame() { return m_rbAFrame; };
  40. btTransform& getBFrame() { return m_rbBFrame; };
  41. const btTransform& getAFrame()const { return m_rbAFrame; };
  42. const btTransform& getBFrame()const { return m_rbBFrame; };
  43. /******************************************************************************/
  44. In src\BulletDynamics\Dynamics\btRigidBody.cpp, void btRigidBody::applyDamping(btScalar timeStep)
  45. Optionally change to match PhysX way of calculating damping
  46. //#define USE_OLD_DAMPING_METHOD 1
  47. #ifdef USE_OLD_DAMPING_METHOD
  48. m_linearVelocity *= GEN_Clamped((btScalar(1.) - timeStep * m_linearDamping), (btScalar)btScalar(0.0), (btScalar)btScalar(1.0));
  49. m_angularVelocity *= GEN_Clamped((btScalar(1.) - timeStep * m_angularDamping), (btScalar)btScalar(0.0), (btScalar)btScalar(1.0));
  50. #else
  51. To
  52. #define USE_OLD_DAMPING_METHOD 1
  53. #ifdef USE_OLD_DAMPING_METHOD
  54. m_linearVelocity *= btClamped((btScalar(1.) - timeStep * m_linearDamping), (btScalar)btScalar(0.0), (btScalar)btScalar(1.0));
  55. m_angularVelocity *= btClamped((btScalar(1.) - timeStep * m_angularDamping), (btScalar)btScalar(0.0), (btScalar)btScalar(1.0));
  56. #else
  57. /******************************************************************************/
  58. In src\LinearMath\btScalar.h
  59. Change
  60. ///#define ATTRIBUTE_ALIGNED16(a) a __attribute__ ((aligned (16)))
  61. ///#define ATTRIBUTE_ALIGNED64(a) a __attribute__ ((aligned (64)))
  62. ///#define ATTRIBUTE_ALIGNED128(a) a __attribute__ ((aligned (128)))
  63. #define ATTRIBUTE_ALIGNED16(a) a
  64. #define ATTRIBUTE_ALIGNED64(a) a
  65. #define ATTRIBUTE_ALIGNED128(a) a
  66. To
  67. #define ATTRIBUTE_ALIGNED16(a) a __attribute__ ((aligned (16)))
  68. #define ATTRIBUTE_ALIGNED64(a) a __attribute__ ((aligned (64)))
  69. #define ATTRIBUTE_ALIGNED128(a) a __attribute__ ((aligned (128)))
  70. /******************************************************************************/
  71. In btQuickprof.h
  72. Change
  73. //#define BT_NO_PROFILE 1
  74. To
  75. #define BT_NO_PROFILE 1
  76. /******************************************************************************/
  77. 10) When building in VS, Select the projects, right click and do "Build Selection"
  78. /******************************************************************************/
  79. ANDROID
  80. edit "lib\build3\Android\jni\Android.mk", add:
  81. LOCAL_CFLAGS += -O3 -fshort-wchar -ffast-math -funsafe-math-optimizations -fomit-frame-pointer
  82. LOCAL_CPPFLAGS += -O3 -fshort-wchar -ffast-math -funsafe-math-optimizations -fomit-frame-pointer
  83. LOCAL_CPP_FEATURES := rtti
  84. LOCAL_ARM_NEON := true
  85. edit "lib\build3\Android\jni\Application.mk", replace with:
  86. APP_PLATFORM := android-18
  87. APP_STL := c++_static
  88. APP_ABI := armeabi-v7a arm64-v8a x86
  89. APP_MODULES := libBullet
  90. APP_OPTIM := release
  91. /******************************************************************************/
  92. MAC
  93. Use manually generated "Mac/Bullet.xcodeproj", but:
  94. -remove all old sources
  95. -manually drag and drop "lib/src/BulletCollision", "lib/src/BulletDynamics", "lib/src/LinearMath" to the project
  96. /******************************************************************************/
  97. LINUX
  98. Use manually generated "Linux/", but:
  99. -remove all old sources
  100. -manually drag and drop "lib/src/BulletCollision", "lib/src/BulletDynamics", "lib/src/LinearMath" to the project
  101. OR
  102. cd lib/build3
  103. ./premake4_linux64 gmake --double
  104. cd gmake
  105. make
  106. /******************************************************************************/