lookAt

fun lookAt(from: Vector3, to: Vector3, up: Vector3 = Vector3.UNIT_Y, target: TransformTarget = TransformTarget.VIEW)(source)

Rotates a transform to look at a given target point in 3D space.

Parameters

from

The starting point of the look-at operation as a Vector3.

to

The target point to look at as a Vector3.

up

The "up" direction as a Vector3, defaulting to UNIT_Y.

target

The transformation target, defaulting to TransformTarget.VIEW.