lookingAt(target:up:useModelFront:)

    Returns a copy of the transform rotated such that the forward axis (-Z) points towards the target position.

    Transform3D.swift:307
    func lookingAt(target: Vector3, up: Vector3 = Vector3 (x: 0, y: 1, z: 0), useModelFront: Bool = false) -> Transform3D

    The up axis (+Y) points as close to the up vector as possible while staying perpendicular to the forward axis. The resulting transform is orthonormalized. The existing rotation, scale, and skew information from the original transform is discarded. The target and up vectors cannot be zero, cannot be parallel to each other, and are defined in global/parent space.

    If useModelFront is true, the +Z axis (asset front) is treated as forward (implies +X is left) and points toward the target position. By default, the -Z axis (camera forward) is treated as forward (implies +X is right).

    Other members in extension

    Type members

    Instance members