Skip to content

Commit

Permalink
feat: use vector_math 32
Browse files Browse the repository at this point in the history
  • Loading branch information
renancaraujo committed Dec 14, 2024
1 parent ce7822a commit bc45d50
Show file tree
Hide file tree
Showing 30 changed files with 32 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'package:flame/src/camera/viewport.dart';
import 'package:flame/src/components/core/component.dart';
import 'package:flame/src/components/position_component.dart';
import 'package:flame/src/effects/provider_interfaces.dart';
import 'package:vector_math/vector_math_64.dart';
import 'package:vector_math/vector_math.dart';

/// This behavior will make the [owner] follow the [target].
///
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dart:ui';

import 'package:flame/src/camera/viewport.dart';
import 'package:vector_math/vector_math_64.dart';
import 'package:vector_math/vector_math.dart';

/// A fixed-size viewport in the shape of a circle (or ellipse).
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'dart:ui';

import 'package:flame/src/camera/viewport.dart';
import 'package:meta/meta.dart';
import 'package:vector_math/vector_math_64.dart';
import 'package:vector_math/vector_math.dart';

/// [FixedAspectRatioViewport] is a rectangular viewport which auto-expands to
/// take as much space as possible within the canvas, while maintaining a fixed
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'dart:ui';

import 'package:flame/src/camera/viewport.dart';
import 'package:vector_math/vector_math_64.dart';
import 'package:vector_math/vector_math.dart';

/// A rectangular viewport with fixed dimensions.
///
Expand Down
2 changes: 1 addition & 1 deletion packages/flame/lib/src/camera/viewports/max_viewport.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'dart:ui';

import 'package:flame/src/camera/viewport.dart';
import 'package:meta/meta.dart';
import 'package:vector_math/vector_math_64.dart';
import 'package:vector_math/vector_math.dart';

/// The default viewport, which is as big as the game canvas allows.
///
Expand Down
2 changes: 1 addition & 1 deletion packages/flame/lib/src/camera/world.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'dart:ui';
import 'package:flame/src/camera/camera_component.dart';
import 'package:flame/src/components/core/component.dart';
import 'package:flame/src/components/mixins/coordinate_transform.dart';
import 'package:vector_math/vector_math_64.dart';
import 'package:vector_math/vector_math.dart';

/// The root component for all game world elements.
///
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:flame/src/components/core/component.dart';
import 'package:vector_math/vector_math_64.dart';
import 'package:vector_math/vector_math.dart';

/// Interface to be implemented by components that perform a coordinate change.
///
Expand Down
2 changes: 1 addition & 1 deletion packages/flame/lib/src/effects/anchor_by_effect.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:flame/src/anchor.dart';
import 'package:flame/src/effects/anchor_effect.dart';
import 'package:flame/src/effects/controllers/effect_controller.dart';
import 'package:flame/src/effects/provider_interfaces.dart';
import 'package:vector_math/vector_math_64.dart';
import 'package:vector_math/vector_math.dart';

/// An [AnchorEffect] that changes its target's anchor by the specified offset.
///
Expand Down
2 changes: 1 addition & 1 deletion packages/flame/lib/src/effects/anchor_to_effect.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:flame/src/anchor.dart';
import 'package:flame/src/effects/anchor_effect.dart';
import 'package:flame/src/effects/controllers/effect_controller.dart';
import 'package:flame/src/effects/provider_interfaces.dart';
import 'package:vector_math/vector_math_64.dart';
import 'package:vector_math/vector_math.dart';

/// An effect that moves the target's anchor to the specified value.
///
Expand Down
2 changes: 1 addition & 1 deletion packages/flame/lib/src/effects/move_by_effect.dart
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import 'package:flame/src/effects/controllers/effect_controller.dart';
import 'package:flame/src/effects/move_effect.dart';
import 'package:flame/src/effects/provider_interfaces.dart';
import 'package:vector_math/vector_math_64.dart';
import 'package:vector_math/vector_math.dart';

/// A [MoveEffect] that moves its target by the specified offset vector.
///
Expand Down
2 changes: 1 addition & 1 deletion packages/flame/lib/src/effects/move_to_effect.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'package:flame/src/effects/controllers/effect_controller.dart';
import 'package:flame/src/effects/move_by_effect.dart';
import 'package:flame/src/effects/move_effect.dart';
import 'package:flame/src/effects/provider_interfaces.dart';
import 'package:vector_math/vector_math_64.dart';
import 'package:vector_math/vector_math.dart';

/// A [MoveEffect] that moves its target towards the given destination point.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import 'package:flame/geometry.dart';
import 'package:flame/math.dart';
import 'package:flame/src/experimental/geometry/shapes/shape.dart';
import 'package:flame/src/game/transform2d.dart';
import 'package:vector_math/vector_math_64.dart';
import 'package:vector_math/vector_math.dart';

/// An axis-aligned rectangle with rounded corners.
///
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import 'package:flame/src/experimental/geometry/shapes/polygon.dart';
import 'package:flame/src/experimental/geometry/shapes/rectangle.dart';
import 'package:flame/src/experimental/geometry/shapes/rounded_rectangle.dart';
import 'package:flame/src/game/transform2d.dart';
import 'package:vector_math/vector_math_64.dart';
import 'package:vector_math/vector_math.dart';

/// Base class for various 2D geometric primitives defined on a Cartesian
/// coordinate plane.
Expand Down
4 changes: 2 additions & 2 deletions packages/flame/lib/src/extensions/matrix4.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:vector_math/vector_math_64.dart';
import 'package:vector_math/vector_math.dart';

export 'package:vector_math/vector_math_64.dart' hide Colors;
export 'package:vector_math/vector_math.dart' hide Colors;

extension Matrix4Extension on Matrix4 {
/// A first row and first column value.
Expand Down
4 changes: 2 additions & 2 deletions packages/flame/lib/src/extensions/vector2.dart
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import 'dart:math';
import 'dart:ui';

import 'package:vector_math/vector_math_64.dart';
import 'package:vector_math/vector_math.dart';

export 'package:vector_math/vector_math_64.dart' hide Colors;
export 'package:vector_math/vector_math.dart' hide Colors;

extension Vector2Extension on Vector2 {
/// This is a reusable vector that can be used within the [Vector2Extension]
Expand Down
2 changes: 1 addition & 1 deletion packages/flame/lib/src/game/notifying_vector2.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:flutter/foundation.dart';
import 'package:vector_math/vector_math_64.dart';
import 'package:vector_math/vector_math.dart';

/// Extension of the standard [Vector2] class, implementing the [ChangeNotifier]
/// functionality. This allows any interested party to be notified when the
Expand Down
2 changes: 1 addition & 1 deletion packages/flame/lib/src/game/transform2d.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'dart:math' as math;
import 'package:flame/geometry.dart' as geometry;
import 'package:flame/src/game/notifying_vector2.dart';
import 'package:flutter/foundation.dart';
import 'package:vector_math/vector_math_64.dart';
import 'package:vector_math/vector_math.dart';

/// This class describes a generic 2D transform, which is a combination of
/// translations, rotations, reflections and scaling. These transforms are
Expand Down
2 changes: 1 addition & 1 deletion packages/flame/lib/src/math/tmp_vector2.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:meta/meta.dart';
import 'package:vector_math/vector_math_64.dart';
import 'package:vector_math/vector_math.dart';

/// Use internally when you need a temporary [Vector2] object but don't want to
/// instantiate a new one due to performance.
Expand Down
2 changes: 1 addition & 1 deletion packages/flame/lib/src/rendering/rotate3d_decorator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'dart:ui';

import 'package:flame/geometry.dart';
import 'package:flame/src/rendering/decorator.dart';
import 'package:vector_math/vector_math_64.dart';
import 'package:vector_math/vector_math.dart';

/// [Rotate3DDecorator] treats the underlying component as if it was a flat
/// sheet of paper, and applies a 3D rotation to it.
Expand Down
2 changes: 1 addition & 1 deletion packages/flame/lib/src/rendering/shadow3d_decorator.dart
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import 'dart:ui';

import 'package:flame/src/palette.dart';
import 'package:flame/src/rendering/decorator.dart';
import 'package:vector_math/vector_math_64.dart' show Matrix4, Vector2;
import 'package:vector_math/vector_math.dart' show Matrix4, Vector2;

/// [Shadow3DDecorator] casts a realistic-looking shadow from the component
/// onto the ground.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'package:flame/camera.dart';
import 'package:flame/experimental.dart';
import 'package:flame_test/flame_test.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:vector_math/vector_math_64.dart';
import 'package:vector_math/vector_math.dart';

void main() {
group('ViewportAwareBoundsBehavior', () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import 'dart:ui';
import 'package:flame/camera.dart';
import 'package:flame_test/flame_test.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:vector_math/vector_math_64.dart';
import 'package:vector_math/vector_math.dart';

void main() {
group('FixedAspectRatioViewport', () {
Expand Down
2 changes: 1 addition & 1 deletion packages/flame/test/components/text_component_test.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flame/src/components/text_component.dart';
import 'package:test/test.dart';
import 'package:vector_math/vector_math_64.dart';
import 'package:vector_math/vector_math.dart';

void main() {
group('TextComponent', () {
Expand Down
2 changes: 1 addition & 1 deletion packages/flame/test/extensions/aabb_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import 'package:test/test.dart';
void main() {
group('Aabb2Extension', () {
// aabb2 is an axis aligned bounding box between a min and a max
// see https://api.flutter.dev/flutter/vector_math_64/Aabb2-class.html
// see https://api.flutter.dev/flutter/package:vector_math/vector_math.dart/Aabb2-class.html
// The extension is used to convert this bounding box to a rect.
test('Default aabb constructor', () {
final aab2 = Aabb2();
Expand Down
2 changes: 1 addition & 1 deletion packages/flame/test/game/notifying_vector2_test.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flame/src/game/notifying_vector2.dart';
import 'package:test/test.dart';
import 'package:vector_math/vector_math_64.dart';
import 'package:vector_math/vector_math.dart';

void main() {
/// This helper function creates a "normal" Vector2 copy of [v1],
Expand Down
2 changes: 1 addition & 1 deletion packages/flame/test/game/transform2d_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import 'dart:math' as math;
import 'package:flame/geometry.dart';
import 'package:flame/src/game/transform2d.dart';
import 'package:test/test.dart';
import 'package:vector_math/vector_math_64.dart';
import 'package:vector_math/vector_math.dart';

void main() {
group('Transform2D', () {
Expand Down
2 changes: 1 addition & 1 deletion packages/flame_test/lib/src/close_to_aabb.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:vector_math/vector_math_64.dart';
import 'package:vector_math/vector_math.dart';

/// Returns a matcher which checks if the argument is an axis-aligned bounding
/// box sufficiently close (within distance [epsilon]) to [expected]. Example
Expand Down
2 changes: 1 addition & 1 deletion packages/flame_test/lib/src/close_to_vector.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import 'package:flutter_test/flutter_test.dart';
import 'package:vector_math/vector_math_64.dart';
import 'package:vector_math/vector_math.dart';

/// Returns a matcher which checks if the argument is a vector within distance
/// [epsilon] of [vector]. For example:
Expand Down
2 changes: 1 addition & 1 deletion packages/flame_test/test/close_to_aabb_test.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flame_test/src/close_to_aabb.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:vector_math/vector_math_64.dart';
import 'package:vector_math/vector_math.dart';

void main() {
group('closeToAabb', () {
Expand Down
2 changes: 1 addition & 1 deletion packages/flame_test/test/close_to_vector_test.dart
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import 'package:flame_test/src/close_to_vector.dart';
import 'package:flutter_test/flutter_test.dart';
import 'package:vector_math/vector_math_64.dart';
import 'package:vector_math/vector_math.dart';

void main() {
group('closeToVector', () {
Expand Down

0 comments on commit bc45d50

Please sign in to comment.