Instance Method

lookAt:

Changes the node's orientation so that its local forward vector points toward the specified location.

Declaration

- (void)lookAt:(SCNVector3)worldTarget;

Parameters

worldTarget

The point, in world space, to face the node toward.

Discussion

Using this method is equivalent to calling the lookAt:up:localFront: method and passing the node's worldUp and localFront vectors for the corresponding parameters.

The effects of this method are animatable; that is, calling this method during an implicit-animation transaction animates the rotation effect. (See Animating SceneKit Content.)

See Also

Performing Node-Relative Operations (SceneKit Types)

- rotateBy:aroundTarget:

Changes the node's position and orientation, relative to its current transform, through a rotation around the specified point in scene space.

- localTranslateBy:

Changes the node's position relative to its current position.

- localRotateBy:

Changes the node's orientation relative to its current orientation.

- lookAt:up:localFront:

Changes the node's orientation so that the specified forward vector points toward the specified location.