如何使用xcode cocos2d项目,包括box2d和chipmunk?
我不知道这听起来是否疯狂。 我有 2 个 xcode 项目,其中 1 个使用 cocos2d-box2d,另一个使用 cocos2d-chipmunk,并且希望将它们合并到一个项目中。 我只知道如何通过选择 box2d/chipmunk 创建项目,但不知道如何将一个引擎导入到带有引擎的现有项目中。 我尝试将文件复制到另一个项目,但 Box2d/chipmunk 类中显示错误。 如何正确地将 Box2D 导入到 Chipmunk 项目(或储备)中?
I don't know if this sounds crazy.
I have 2 xcode projects, 1 using cocos2d-box2d and the other using cocos2d-chipmunk, and want to merge them into one single project.
I just know how to create project with choosing box2d/chipmunk, but not import one engine to an existing project with an engine.
I tried to copy files to another project and errors showed at Box2d/chipmunk classes.
How to import Box2D to a Chipmunk project (or the reserve) correctly?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
不要将它们都放入您的项目中。为每个物理引擎创建一个静态库目标。这样您就可以确保它们单独构建,并在必要时为每个应用自定义构建设置。
由于您已经在转换项目,您可能会发现直接迁移到 Kobold2D 会更容易。 Box2D 和 Chipmunk 都已安装完毕并可以使用,没有什么反对在同一项目中使用两者的。您需要做的就是添加两个物理引擎的标头,然后就可以开始了。
PS:是的,这听起来确实很疯狂。 :)
Do not drop them both into your project. Create a static library target for each physics engine. That way you can make sure they build separately, and apply custom build settings for each where necessary.
Since you're already in the process of converting a project you may find it easier to migrate to Kobold2D directly. Both Box2D and Chipmunk are setup and ready to use, there's nothing speaking against using both in the same project. All you'd need to do is add the headers for both physics engines and you're ready to go.
PS: yes, it DOES sound crazy. :)
有哪些错误?不应该有任何东西会阻止 Box2D 和 Chipmunk 存在于同一可执行文件中。我最好的猜测是您的项目中有其他重复的符号,或者需要调整某些内容的编译设置。
What were the errors? There shouldn't be anything that would prevent Box2D and Chipmunk from existing in the same executable. My best guess is that you have other duplicate symbols in the project or need to tweak the compile settings for something.