applyAngularImpulse(_:duration:)
Creates an action that applies an angular impulse to a node’s physics body.
Declaration
class func applyAngularImpulse(_ impulse: CGFloat, duration: TimeInterval) -> SKActionParameters
- impulse:
The total impulse to apply to the physics body. The impulse is measured in Newton-seconds.
- duration:
The number of seconds over which to apply the impulse. For example, if you specify a duration of four seconds, one quarter of the impulse will be applied each second.
Return Value
A new action object.
Discussion
When the action executes, applies a constant torque to the physics body for the duration of the action. The torque is calculated by dividing the impulse strength by the duration of the action. This action affects the body’s angular velocity without changing the body’s linear velocity.
This action is reversible; it applies an equal angular impulse in the opposite direction.
See Also
Animating Properties of a Node’s Physics Body
applyForce(_:duration:)applyTorque(_:duration:)applyForce(_:at:duration:)applyImpulse(_:duration:)applyImpulse(_:at:duration:)applyImpulse(_:duration:)changeCharge(to:duration:)changeCharge(by:duration:)changeMass(to:duration:)changeMass(by:duration:)strength(to:duration:)strength(by:duration:)falloff(to:duration:)falloff(by:duration:)