Search code examples
iosxcodexcode4bulletphysics

Setting up Bullet Physics for iOS in XCode 4


So, I have downloaded the latest Bullet Physics package (2.78) and I have read the "Getting Started" documentation, which even includes an article on setting up a project in XCode from scratch (but not targeted at iOS nor XCode 4, which is what I'm using). Even so, I am still not able to set this up.

The following are the steps I'm currently taking:

  1. I'm adding the Bullet Physics "src" folder in the classes of the Xcode

  2. I'm including the Bullet Physics "src" folder path in the debug and release "Header Search Paths" in XCode

  3. I add #include "btBulletDynamicsCommon.h" to the file where I want to use Bullet Physics

  4. I change the Objective-C file to Objective-C++ by changing its file extension from "m" to "mm". This is the file where the "btBulletDynamicsCommon.h" is included

After I follow these steps, the compiler complaints about missing files (first few errors, there are 999+ errors shown when I try to build).

These are the first few headers missing in the btSoftBodySolverVertexBuffer_DX11.h:

#include <windows.h>
#include <crtdbg.h>
#include <d3d11.h>
#include <d3dx11.h>
#include <d3dcompiler.h>

Now, I'm pretty new with XCode and iOS, so the fact that these are missing doesn't really tell me much on how to solve this issue, and it makes me even wonder if they are at all needed for iOS development given the appended "DX11" on the file name that is having this issue.

So, what I would appreciate is either information on what's possibly wrong, or information on how to set up Bullet Physics to be used with iOS in XCode 4, from scratch.

Thanks.

Update: I have completely removed the DX11 and OpenCL and I'm now able to compile after step 4 above. I have not yet actually tested the Bullet Physics framework to see if it works without issues. But this now leads me to ask:

What are the specific source files/folders that are strictly necessary to run Bullet Physics in iOS?


Solution

  • There is a tutorial with step by step instruction for integrating Bullet Physics with iOS and Apple's GLKit framework http://www.informit.com/articles/article.aspx?p=1914612

    The example code downloadable with the tutorial will get you started quickly and produces an interesting simulation.