An action which animates the transform of an entity to revolve around a specified pivot entity.
This action moves an entity in a circular path by gradually adjusting its local transform.
The animation starts from the entity's initial transform, and rotates around the pivot
entity. The ``OrbitEntityAction/orbitalAxis`` specifies which cartesian axis
to rotate around in world space.. The axis is resolved when the action starts to produce an axis
of rotation around the pivot entity.
The full orbit completes after the action has ended.
The example below creates an animation that orbits an entity
around the x-axis two times for five seconds.
```swift
// Create an action entity resolution to the pivot entity
// that exists in the scene.
let pivotEntity: ActionEntityResolution = .entityNamed("pivotEntity")
// Create an action that performs an orbit around the
// specified pivot entity.
let orbitEntityAction = OrbitEntityAction(pivotEntity: pivotEntity,
revolutions: 2,
orbitalAxis: [0, 1, 0],
isOrientedToPath: true,
isAdditive: false)
// A five second animation that plays an animation causing the entity to
// orbit around the pivot.
let orbitAnimation = try AnimationResource
.makeActionAnimation(for: orbitEntityAction,
duration: 5.0,
bindTarget: .transform)
// Play the five second orbit animation.
entity.playAnimation(orbitAnimation)
```
- Note: Use the ``OrbitEntityAction/orbitalAxis`` to determine whether the entity
orbits clockwise or counterclockwise.
- Important: This action directly animates the ``BindTarget/transform`` on the bound entity.
Ensure a correct bind target is supplied when creating the animation.
- Important: For a successful orbit, ensure the translational offset between the target and pivot entity are not parallel to the orbit axis.
Creates a new orbit entity action.
- Parameters:
- pivotEntity: The pivot entity that the targeted entity will orbit.
- revolutions: The number of rotations to complete before stopping.
- orbitalAxis: A vector that describes the axis of rotation (in world space).
- isOrientedToPath: Indicates whether the orbiting target entity updates
its orientation during the animation to orient itself
along the rotation path.
- isAdditive:A Boolean value that indicates whether the animation system additively blends
the action's output with the base value.
get · iOS 18.0+
pivotEntity
TypeScript
get pivotEntity(): ActionEntityResolution
Swift declaration
var pivotEntity: ActionEntityResolution
The entity that the target entity orbits around.
set · iOS 18.0+
pivotEntity
TypeScript
set pivotEntity(value: ActionEntityResolution)
Swift declaration
var pivotEntity: ActionEntityResolution
The entity that the target entity orbits around.
get · iOS 18.0+
isAdditive
TypeScript
get isAdditive(): boolean
Swift declaration
var isAdditive: Bool
A Boolean value that indicates whether the animation system additively blends the action's output with the base value.
set · iOS 18.0+
isAdditive
TypeScript
set isAdditive(value: boolean)
Swift declaration
var isAdditive: Bool
A Boolean value that indicates whether the animation system additively blends the action's output with the base value.
get · iOS 18.0+
orbitalAxis
TypeScript
get orbitalAxis(): SDKHandle
Swift declaration
var orbitalAxis: SIMD3<Float>
A vector that describes the axis of rotation (in world space).
The default value of this property is `[0, 1, 0]`, meaning the rotation
occurs around the y-axis.
set · iOS 18.0+
orbitalAxis
TypeScript
set orbitalAxis(value: SDKHandle)
Swift declaration
var orbitalAxis: SIMD3<Float>
A vector that describes the axis of rotation (in world space).
The default value of this property is `[0, 1, 0]`, meaning the rotation
occurs around the y-axis.
get · iOS 18.0+
revolutions
TypeScript
get revolutions(): number
Swift declaration
var revolutions: Float
The number of rotations to complete before stopping.
set · iOS 18.0+
revolutions
TypeScript
set revolutions(value: number)
Swift declaration
var revolutions: Float
The number of rotations to complete before stopping.
get · iOS 18.0+
isOrientedToPath
TypeScript
get isOrientedToPath(): boolean
Swift declaration
var isOrientedToPath: Bool
A Boolean value that indicates whether the orbiting
object updates its orientation during the animation to orient itself
along the rotation path.
The default value of this property is `false`.
set · iOS 18.0+
isOrientedToPath
TypeScript
set isOrientedToPath(value: boolean)
Swift declaration
var isOrientedToPath: Bool
A Boolean value that indicates whether the orbiting
object updates its orientation during the animation to orient itself
along the rotation path.
The default value of this property is `false`.
Skipped declarations
1 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.