Skip to content

feat: Add vector projection and inversion#1787

Merged
spydon merged 3 commits into
mainfrom
spydon/vector2-projection-inversion
Jul 9, 2022
Merged

feat: Add vector projection and inversion#1787
spydon merged 3 commits into
mainfrom
spydon/vector2-projection-inversion

Conversation

@spydon
Copy link
Copy Markdown
Member

@spydon spydon commented Jul 8, 2022

Description

Adding projection, ìnvert and inverted to the vector extension.

Checklist

  • The title of my PR starts with a Conventional Commit prefix (fix:, feat:, docs: etc).
  • I have read the Contributor Guide and followed the process outlined for submitting PRs.
  • I have updated/added tests for ALL new/updated/fixed functionality.
  • I have updated/added relevant documentation in docs and added dartdoc comments with ///.
  • I have updated/added relevant examples in examples.

Breaking Change

  • No, this is not a breaking change.

Related Issues

@spydon spydon requested review from a team and st-pasha July 8, 2022 06:59
@spydon spydon mentioned this pull request Jul 8, 2022
9 tasks
Comment thread packages/flame/lib/src/extensions/vector2.dart
Comment thread packages/flame/lib/src/extensions/vector2.dart Outdated
Comment thread packages/flame/test/extensions/vector2_test.dart
/// [other] needs to have a length > 0;
/// If [out] is specified, it will be used to provide the result.
Vector2 projection(Vector2 other, {Vector2? out}) {
assert(other.length2 > 0, 'other needs to have a length > 0');
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

imho, we should have a test for this assertion as well to ensure it stays

@spydon spydon merged commit d197870 into main Jul 9, 2022
@spydon spydon deleted the spydon/vector2-projection-inversion branch July 9, 2022 18:00
st-pasha pushed a commit to st-pasha/flame that referenced this pull request Jul 13, 2022
Adding projection, ìnvert and inverted to the vector extension.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants