lookAt method

void lookAt(
  1. Vec3 point, {
  2. Vec3 worldUp = Vec3.up,
})
inherited

Turns the object to look at point, in the world, with its up as close to worldUp as it can be. At point already, it has nowhere to look, and stays as it is.

Implementation

void lookAt(Vec3 point, {Vec3 worldUp = Vec3.up}) {
  if (_rotationToLookAt(point, worldUp) case final rotation?) _setRotation(rotation);
}