Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Math] Add a couple of helpers for Vectors #1769

Merged
merged 11 commits into from Oct 17, 2023
Merged

Conversation

ch3mbot
Copy link
Contributor

@ch3mbot ch3mbot commented Sep 16, 2023

PR Details

Made a few simple changes to Vector3 and Int3 to add some helpful functions found in other game engines.

Description

Added the following:
a Vec3 constructor taking an Int3 (maybe not necessary with the implicit cast)
a function in Vec3 to round it and return an Int3
an uncast length calculation to Int3 (returns a float similar to Vec3.Length)
an implicit cast form Int3 to Vec3

Types of changes

  • Docs change / refactoring / dependency upgrade
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

ch3mbot and others added 10 commits September 16, 2023 08:49
Created a function that round a Vector3 to an Int3, since the cast in Vector3.cs doesn't round.
Constructor for Vector3 struct that takes an Int3 as an argument
an unrounded length calculation
Added implicit cast from Int3 to Vector3
Added GetUnsafe to Entity.cs
added GetUnsafe to EntityComponentCollection.cs to get interfaces
This reverts commit 93c9f79.
Added implicit cast from Int3 to Vector3
This reverts commit 95da7ce.
@Eideren Eideren changed the title Patch 1 [Math] Add a couple of helpers for Vectors Sep 24, 2023
@Eideren
Copy link
Collaborator

Eideren commented Oct 16, 2023

@ch3mbot should we merge this in or do you still want to change the naming scheme ?

Changed LengthUnrounded to LengthUntrunctated to be more accurate.
@ch3mbot
Copy link
Contributor Author

ch3mbot commented Oct 17, 2023

Changed LengthUnrounded to LengthUntrunctated to be more accurate. Good to merge.

@Eideren Eideren marked this pull request as ready for review October 17, 2023 21:56
@Eideren Eideren merged commit 51f60ac into stride3d:master Oct 17, 2023
1 check passed
@Eideren
Copy link
Collaborator

Eideren commented Oct 17, 2023

Thanks !

Kryptos-FR added a commit to Kryptos-FR/stride that referenced this pull request Oct 18, 2023
Kryptos-FR added a commit to Kryptos-FR/stride that referenced this pull request Oct 18, 2023
Kryptos-FR added a commit to Kryptos-FR/stride that referenced this pull request Oct 18, 2023
Eideren pushed a commit that referenced this pull request Oct 18, 2023
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.

None yet

3 participants