(breaking) vec: Rework vec2.to_vec3; add vec3.to_xz#81
Draft
idbrii wants to merge 1 commit intoexcessive:masterfrom
Draft
(breaking) vec: Rework vec2.to_vec3; add vec3.to_xz#81idbrii wants to merge 1 commit intoexcessive:masterfrom
idbrii wants to merge 1 commit intoexcessive:masterfrom
Conversation
* Replace vec2.to_vec3 with vec3.from_table. * Add vec3.to_xz, vec3.to_xy, vec3.to_table. * Add vec2.to_table for completeness. Simplify converting into flat plane math. Often I want to do math on the ground plane, so it's helpful to easily convert vec3 into vec2 (like for angle_to). Remove vec2.to_vec3 so vec3 can depend on vec2 instead and we can do to_xz and to_xy, which seem far more useful. vec3.from_table(a) is mostly equivalent to to_vec3, but doesn't accept a value for z. Add to_table as a pair for from_table and for converting into a serializable. No vec2.from_table because it's the same as vec2.new.
Contributor
Author
|
From the failed test:
I guess for ffi, I have to make it from_vec2. |
Collaborator
|
That's rough... |
This file contains hidden or 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
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.
Simplify converting into flat plane math. Often I want to do math on the
ground plane, so it's helpful to easily convert vec3 into vec2 (like for
angle_to).
Remove vec2.to_vec3 so vec3 can depend on vec2 instead and we can do
to_xz and to_xy, which seem far more useful. vec3.from_table(a) is
mostly equivalent to to_vec3, but doesn't accept a value for z.
Add to_table as a pair for from_table and for converting into a
serializable. No vec2.from_table because it's the same as vec2.new.
What do you think about this one? Maybe all the to/from_table should be removed and just add vec3.from_vec2?