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.
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
RFC: Vector library #34
base: master
Are you sure you want to change the base?
RFC: Vector library #34
Changes from 15 commits
7bb768f
4eb1d96
0bb608a
2d5cdd7
54c5b19
62c86b4
dcb7abd
39e3f87
4c0c3ce
9966eae
946af7b
1092513
364d2be
ba2f90e
3017ab7
80781a7
6eb512b
4e6b581
6c8890a
a98da09
7de8372
f6b24eb
f4e7284
df7b314
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we note how it behaves for 4-wide vectors?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm unsure of the behavior it should have - I would simply use only the first three components even when compiled in four component mode. The other options are to error or compute the dot product of vectors with four components, which a quick google returns little results for.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think having it only work on the first 3 components is correct.
$$a \cdot b = \sum_{i=1}^n a_i b_i$$
$$\vec{a} \cdot \vec{b} = a_1 b_1 + a_2 b_2 + a_3 b_3 + a_4 b_4 $$
If we were to follow the definition of the dot product between 2 vectors
we can say that the dot product for four component vectors would be:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
string library sets the metatable of string values by default, so there is precedent (
luaopen_string
).There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To clarify, I mean there is no library which has an implicit
__call
metamethod on it. There's no luau library that lets you do, for example,string()
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's not what the RFC text says. It still says "there is currently no library with a metatable set by default" and that's not true. If it said that there's no library with a
__call
metamethod set on a type, that would be true.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
resolved