Closed xuankaicat closed 1 year ago
Should we switch to Vector**c variants such as Vector3fC, Vector2ic, etc? it can allow alternative implementations of vector to work with our util
Oh, nvm, those are immutable
Hmm, methods such as plus
can be implemented immutable, while plusAssign
must be mutable, I think implementing immutable methods only for Vector**c variants can work
Plus, should Quaternion rotation be considered as multiplication? It is indeed multiplication in complex number sense, and the way it is represented in programming is same as Vector, with different sets of methods
I've... found a issue, Mutable vector classes such as Vector4f
defines method such as div
, and kotlin calls it instead of our extension function.
and that div
function mutates itself, so doing "val c = a / b" will mutate a
. Since it's member method it's not possible to override.
One solution would be requiring users to declare type of a
as read-only one(Vector4fc
in this context)
I've added functionalities that I missed(twice) in my branch based on your PR, feel free to cherry-pick it. https://github.com/tmvkrpxl0/KotlinForForge/commits/3.x-cat I've added: division operator (I somehow missed this twice) Iterator for iterating elements in x,y,z,w order index access method, [0] is x and [1] is y and so on. It can also set it Created Vector4dcUtil.kt
Tester also tests these new functionalities, 30 times in a row.
Upgrade KFF for support 1.19.3. I renamed
clone
in vector util todeepCopy
for avoiding the shadow inorg.joml.*
.