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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
This reverts commit 8f034d1.
manio143
reviewed
Sep 17, 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.
Changed LengthUnrounded to LengthUntrunctated to be more accurate. Good to merge. |
Thanks ! |
Kryptos-FR
added a commit
to Kryptos-FR/stride
that referenced
this pull request
Oct 18, 2023
…ferent rounding strategy if needed.
Kryptos-FR
added a commit
to Kryptos-FR/stride
that referenced
this pull request
Oct 18, 2023
…ferent rounding strategy if needed.
Kryptos-FR
added a commit
to Kryptos-FR/stride
that referenced
this pull request
Oct 18, 2023
…ferent rounding strategy if needed.
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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