Type Method

rotateToX:y:z:duration:shortestUnitArc:

Creates an action that rotates the node to absolute angles in each of the three principal axes.

Declaration

+ (SCNAction *)rotateToX:(CGFloat)xAngle y:(CGFloat)yAngle z:(CGFloat)zAngle duration:(NSTimeInterval)duration shortestUnitArc:(BOOL)shortestUnitArc;

Parameters

xAngle

The amount to rotate the node counterclockwise around the x-axis of its local coordinate space, in radians.

yAngle

The amount to rotate the node counterclockwise around the y-axis of its local coordinate space, in radians.

zAngle

The amount to rotate the node counterclockwise around the z-axis of its local coordinate space, in radians.

duration

The duration, in seconds, of the animation.

shortestUnitArc

If NO (the default), the animation interpolates each component of the node’s rotation between its current value and the new value. If YES, the animation makes the most direct rotation possible from the node’s current orientation to the new orientation.

Return Value

A new action object.

Discussion

When the action executes, the node’s rotation property animates to the new angle.

This action is not reversible; the reverse of this action has the same duration but does not change anything.

See Also

Creating Actions That Rotate a Node

+ rotateByX:y:z:duration:

Creates an action that rotates the node in each of the three principal axes by angles relative to its current orientation.

+ rotateToX:y:z:duration:

Creates an action that rotates the node to absolute angles in each of the three principal axes.

+ rotateByAngle:aroundAxis:duration:

Creates an action that rotates the node by an angle around a specified axis.

+ rotateToAxisAngle:duration:

Creates an action that rotates the node to an absolute angle around a specified axis.