Adding Open Source 3D Physics to Your iOS Applications(2) Moving Bullet to iOS
来源:互联网 发布:淘宝推广教程 编辑:程序博客网 时间:2024/05/21 10:04
Moving Bullet to iOS
Now that everything works on Mac OS X, the next step is to get relevant portions of Bullet working for iOS. Most of Bullet's demonstration applications are ill-suited for iOS, but the core engine features work without modification.
Create a new Xcode project by choosing File > New > New Project. Select the iOS Single View Application project template shown in Figure 7. Other project templates for iOS can be used, but stick with the relatively simple Single View Application for this tutorial.
Figure 7 Xcode project templates
Next, name your new project. Figure 8 shows a Product Name=Physics, Company Identifier=P, and Class Prefix=P. You can use any name and prefix you want. Be sure to save the new project inside the bullet-2.80-rev2531 folder. This tutorial assumes Use Storyboard and Use Automatic Reference Counting options are checked, as shown in Figure 8.
Figure 8 Xcode options for a new iOS application
Add pertinent Bullet source code to your new project. It's possible to build Bullet as an iOS static library and include just the compiled libraries in your new project, but it's simpler for this example to just add Bullet source code. Use Xcode's File > Add Files to Physics menu item. If you named your product something other than "Physics," the menu item will display your product's name. Figure 9 shows Bullet folders: BulletCollision, BulletDynamics, and LinearMath. They are added to the Xcode "Physics" product. Make sure the option Copy Items to Destination Group's Folder (If Needed) is not checked.
Figure 9 Adding Bullet source code to the Xcode project
Some of the files within the BulletCollision, BulletDynamics, and LinearMath folders just added are not relevant or compatible with iOS. Delete references to any extra files by selecting them in Xcode and pressing the Delete or Backspace key on the keyboard. The Xcode project should look like Figure 10 when you have the correct files.
Figure 10 Bullet folders added to the Xcode project
Select the Build Settings for the project as shown in Figure 11, and add the $(SRCROOT)/../src to the Header Search Paths setting. This setting is necessary for Xcode to find Bullet header files.
Figure 11 Add $(SRCROOT)/../src to Xcode's Header Search Paths setting
Press the Run button in Xcode, and a new iOS application including Bullet physics will be generated. You should see a plain white screen in the iPhone simulator or on your iOS device. The new application doesn't call any physics functions or draw anything yet. It's normal to see 11 compiler warnings generated from Bullet source code at this stage.
- Adding Open Source 3D Physics to Your iOS Applications(2) Moving Bullet to iOS
- Adding Open Source 3D Physics to Your iOS Applications (3)Using Bullet in Your iOS Application
- Adding Open Source 3D Physics to Your iOS Applications(1)
- Adding 2D physics to your XNA Game Studio game
- iPhone Open Source Project - Bullet 3D Game
- GIS for Web Developers: Adding 'Where' to Your Web Applications [ILLUSTRATED]
- Adding profiling instructions to applications with Soot
- 22 Open Source PHP Frameworks To Shorten Your Development Time
- How to use open source SIP stack to build High availability Applications
- Adding Windows To Your Console Application
- Adding Logic Flow Control to Your Programming
- Adding Three20 to your Xcode project
- Adding RF 433MHz to your Arduino
- Adding Object Subscripting Support to Your Classes
- Adding Meaning to your steps轨迹导论
- Adding new Code to your GitHub Repository
- 14.Adding Frontend Files to your Module
- Example Source Code: Using Face Detection To Create The Illusion Of Real 3D On iOS Devices
- Adding Open Source 3D Physics to Your iOS Applications(1)
- CCheckListBox控件
- android的ProgressBar设置为水平样式
- 蝴蝶兰与鳞托菊
- C语言写的21位花朵数
- Adding Open Source 3D Physics to Your iOS Applications(2) Moving Bullet to iOS
- 3D模型读取库:Assimp
- python迭代器
- linux awk 中 printf 使用方法
- 乱七八糟
- 我的歌声里(程序员版)
- Adding Open Source 3D Physics to Your iOS Applications (3)Using Bullet in Your iOS Application
- TCP/IP、Http、Socket的区别
- C# 删除word的指定页