Merged
Conversation
Signed-off-by: zNotChill <znotchill@znci.dev>
Signed-off-by: zNotChill <znotchill@znci.dev>
Signed-off-by: zNotChill <znotchill@znci.dev>
Qodana Community for JVM88 new problems were found
☁️ View the detailed Qodana report Contact Qodana teamContact us at qodana-support@jetbrains.com
|
Signed-off-by: zNotChill <znotchill@znci.dev>
gibbiemonster
approved these changes
May 10, 2025
Contributor
gibbiemonster
left a comment
There was a problem hiding this comment.
LGTM, but remember to bump twine version.
src/main/kotlin/dev/znci/rocket/scripting/globals/tables/Math.kt
Outdated
Show resolved
Hide resolved
gibbiemonster
requested changes
May 10, 2025
Contributor
gibbiemonster
left a comment
There was a problem hiding this comment.
Nevermind. Write unit tests 🙂
Signed-off-by: zNotChill <znotchill@znci.dev>
Contributor
Author
|
Reviewing again right now is not necessary, since I am now working on unit tests which I will finish tomorrow. |
Signed-off-by: zNotChill <znotchill@znci.dev>
gibbiemonster
approved these changes
May 11, 2025
Contributor
gibbiemonster
left a comment
There was a problem hiding this comment.
Just some test style things. Otherwise, they pass and run.
Well done 🙂
src/test/kotlin/dev/znci/rocket/scripting/globals/tables/LuaLocationTest.kt
Show resolved
Hide resolved
src/test/kotlin/dev/znci/rocket/scripting/globals/tables/LuaVector3Test.kt
Show resolved
Hide resolved
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.
This PR aims to add 3d vectors with a handful of useful utility functions, taking use of Twine's new overloading feature.
Unfortunately, due to the fact that Lua has a built-in math library, this does override it. Which is why I have tried to re-implement the expected behaviour from existing math functions.
As far as I know, this re-implements nearly all of the existing math functions. The only current issue is min and max functions not working, due to Twine's lack of a working vararg system. Hopefully, this will be addressed and fixed by me or somebody else if needed.
The reason for this custom math library is that vector utilities would be very useful, such as
math.abs(Double)andmath.abs(Vector3)This PR could be merged, since any existing issues would be addressed and fixed later on, and I think its important for vectors to exist in the main branch before any world/entity stuff is started.