Jonathan Cornaz

Results 127 comments of Jonathan Cornaz

What would you think about the following design: ```kotlin data class ImVector2(val x: Float = 0f, val y: Float = 0f) { val isZero get() = x == 0f &&...

>Not sure about the name of the class. We could either go with a verbose ImmutableVector2, or a less obvious KVector2. I'm leaning towards KVector2, what do you think? I...

Actually, does it make sense to have immutable vectors without having immutable matrix and quaternions? I'm starting to think that adding everything would be too much. And maybe this feature...

Should we provide operators overloads accepting LibGDX `VectorN` as arguments? For instance on could do `val newImmutableVector = immutableVector + mutableVector`. **PROS:** * Smoother integration with LibGDX vectors * Better...

Yes I started it. I want to add some tests before creating the PR. I'll see if I have time to propose something this weekend

I'm basing my tests on the fact that "all my functions should return same value LibGDX `Vector2` would have returned for the same given arguments". However LibGDX returns quite strange...

I open an issue for it: https://github.com/libgdx/libgdx/issues/5385

>I think we should choose correctness over consistency It's not only inconsistent. It is incorrect as well. `println(Vector2(0.0f, 1f).angleRad(Vector2.X))` should print `1.5707964`, not `-1.5707964`. Here `-1.5707964` is incorrect.

This one is quite an edge case case, and is only about consistency: ```kotlin println(Vector2(-1f, -0f).angleRad()) // -3.1415927 println(Vector2(-1f, -0f).angle()) // 180.0 ``` Here the "problem" is the fact that...

I would not bother too much about that. Users can create typealiases if they want shorter names in their code. ```kotlin typealias ImList = ImmutableList typealias ImCol = ImmutableCollection typealias...