effectiveYaw property

double get effectiveYaw

Effective yaw angle of the boom.

Implementation

double get effectiveYaw {
  if (!inheritYaw || !isAttached) return yaw;
  final ownerRot = vm.Quaternion.identity();
  node.globalTransform.decompose(
    vm.Vector3.zero(),
    ownerRot,
    vm.Vector3.zero(),
  );
  final qx = ownerRot.x;
  final qy = ownerRot.y;
  final qz = ownerRot.z;
  final qw = ownerRot.w;
  final ownerYaw = math.atan2(
    2 * (qw * qy + qz * qx),
    1 - 2 * (qy * qy + qz * qz),
  );
  return ownerYaw + yaw;
}