Type Method

rotateByAngle:aroundAxis:duration:

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

Declaration

+ (SCNAction *)rotateByAngle:(CGFloat)angle aroundAxis:(SCNVector3)axis duration:(NSTimeInterval)duration;

Parameters

angle

The amount to rotate the node counterclockwise around the specified axis, in radians.

axis

A vector in the node’s local coordinate space whose direction specifies the axis of rotation.

duration

The duration, in seconds, of the animation.

Return Value

A new action object.

Discussion

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

This action is reversible; the reverse is created as if the following code had been executed:

[SCNAction rotateByAngle: -angle aroundAxis: axis duration: sec];

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.

+ rotateToX:y:z:duration:shortestUnitArc:

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

+ rotateToAxisAngle:duration:

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