summaryrefslogtreecommitdiff
path: root/plugins/aves_utils/lib/src/vector_utils.dart
blob: 14f3207849599b1e6cfcc011de0368b57f95f4d7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import 'dart:ui';

import 'package:vector_math/vector_math_64.dart';

extension ExtraOffset on Offset {
  Vector3 get toVector3 => Vector3(dx, dy, 0);
}

extension ExtraVector3 on Vector3 {
  Offset get toOffset => Offset(x, y);
}

extension ExtraMatrix4 on Matrix4 {
  Offset transformOffset(Offset v) => transform3(v.toVector3).toOffset;
}