Skip to content
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

Make Half, Vectors, Matrices, Quaternion, and Ray serializable #55

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

RowDaBoat
Copy link

@RowDaBoat RowDaBoat commented Jul 5, 2024

Motivation

I am using kotlin-math on my game engine and need vectors and matrices to be serializable to model my scene. To achieve this, I forked and added serialization using kotlinx-serialization. The serialization library maintains the multiplatform nature of kotlin-math.

Changes

  • Added kotlinx-serialization dependency
  • Added the @Serializable annotation to Half, Mat2, Mat3, Mat4, Quaternion, Rational, Ray, Float2, Float3, Float4, Bool2, Bool3, Bool4, Half2, Half3, and Half4

I hope you find my contribution useful.

@romainguy
Copy link
Owner

Thanks for your contribution but I'm conflicted about this. I don't like the idea of a simple math library taking on such dependencies. I also feel that the serialization code should be external to those types considering how simple they are.

@RowDaBoat
Copy link
Author

I understand, it makes sense to keep it simple.
Thanks for the reply.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants