-
Notifications
You must be signed in to change notification settings - Fork 36
Animations
Add these animations to your RealityKit entities for a smoother looking Augmented Reality environment.
With RealityKit, the entities will always rotate along the shortest path to the end orientation, but that means any it will never rotate beyond 180º on its own. For example, if an entity is instructed to turn by 359º clockwise, it will instead turn 1º anti-clockwise (or counter-clockwise if you rather). Entity.ruiSpin allows you to spin an object for as long as you like.
External extensions not yet supported by DocC
myModel.ruiSpin(by: [0, 1, 0], period: 1, times: 2)
Subtle but important for UX, you can animate a shake or nudge an entity with Entity.ruiShake. Useful for signalling something wants attention (like an incoming call or message), or in an Augmented Reality game if something isn't done right this feature could signal that.
External extensions not yet supported by DocC
myModel.ruiShake(by: simd_quatf(angle: .pi / 8, axis: [0, 1, 0]), period: 1, times: 6)