This package is based on the package ARKit-FocusNode, but adapted to work in Apple's framework RealityKit.
The Example looks identical to the above GIF, which uses the FocusEntity classic style.
If you're unfamiliar with using RealityKit, I would also recommend reading my articles on Getting Started with RealityKit.
Add the URL of this repository to your Xcode 11+ Project.
Go to File > Swift Packages > Add Package Dependency, and paste in this link:
See the Example for a full working example as can be seen in the GIF above
FocusEntityto your .swift file
let focusSquare = FocusEntity(on: self.arView, style: .classic)
focusSquare.delegateto an object which conforms to
FocusEntityDelegateif you wish to get callbacks for when the FocusEntity changes state.
let onColor: MaterialColorParameter = try .texture(.load(named: "<#customAsset1#>"))
let offColor: MaterialColorParameter = try .texture(.load(named: "<#customAsset2#>"))
If something's not making sense in the Example, send me a tweet or Fork & open a Pull Request on this repository to make something more clear.
I'm hoping to make the animations look a little smoother over time, but any and all contributions are welcome and encouraged.
The original code to create this repository has been adapted from one of Apple's examples from 2018, license also included. I have merely adapted the code to be used and distributed from within a Swift Package, and now further adapted to work with RealityKit.
|Last commit: 4 weeks ago|
Fix setAutoUpdate method.