-
-
Notifications
You must be signed in to change notification settings - Fork 164
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
Add lerp & smoothstep to math module #2254
Conversation
8d95de5
to
15f85ff
Compare
545d673
to
b980dcc
Compare
b980dcc
to
8f6be50
Compare
I'm surprised that these functions do vectors and numbers. It seems reasonable to have the module functions just do numbers and the vector methods do vectors. There's already a way to lerp two vectors together, with vector.lerp. |
I agree with Starbuck. We should add a That way there is one clear way to do it with either type of thing. |
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.
As commented above. Please make the module level functions for scalars only, and - if you like add the vector code for smoothstep as a method for the Vector classes.
This is to keep it consistent with the already existing Vector2.lerp()
& Vector3.lerp()
.
It has been a long ass time, for me to get around to reviewing this so also happy to take this over if you don't want to make any changes.
# Conflicts: # src_c/doc/math_doc.h
Tidied this up a bit to respond to reviews. |
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.
Code looks great, seems to run fine, these are wonderful additions. Although I'm not sure why the vector methods don't use METH_FASTCALL
too, but that can be changed later if necessary.
e.g.