Hello!
I have created an open source wrapper around Bullet for use in iOS / macOS applications which can be found here https://github.com/AdamEisfeld/PhyKit.
![Image](https://user-images.githubusercontent.com/2840242/103972814-ce3da980-513b-11eb-8f7a-cc102e3a3078.gif)
As I have been working on a personal project backed by Apple's SceneKit library (provides an abstraction for rendering 3D scenes via OpenGL / Metal, wired up to a stock physics engine), I found the physics engine implementation that comes with SceneKit to be a little lacking. Primarily, I needed a way to do client-side prediction / server reconciliation, which required the ability to manually "step" the physics simulation forward after applying some historical client inputs, which SceneKit does not support (ironically, I believe Apple is using Bullet under the hood, but their API does not support what I'm after and feature requests from a single developer tend to not happen).
PhyKit is compiled as a universal xcframework, targeting iOS simulators / devices as well as macOS. The framework can be downloaded directly from the repo and dragged into your Xcode project, or you can use Swift Package Manager or CocoaPods to install the framework as a dependency.
At it's core, the framework provides functionality for:
- Creating a physics world (PHYWorld)
- Creating various collision shapes, including from SCNNode geometry (PHYCollisionShape)
- Creating rigid bodies (PHYRigidBody)
- Creating ghost objects (PHYTrigger)
- Attaching rigid bodies to SCNNodes
- Raycasting
- PHYActions (performing a piece of logic on a node over time, such as PHYAction.moveTo(x, y, z, 10) or PHYAction.orientBy(x, y, z, 20)
Contributions welcome!
- Adam