forward property

Vector3 get forward

The unit look direction. At yaw 0, pitch 0 this is (0, 0, -1).

Implementation

Vector3 get forward {
  final cp = math.cos(_pitch);
  return Vector3(
    -math.sin(_yaw) * cp,
    math.sin(_pitch),
    -math.cos(_yaw) * cp,
  );
}