pmmp / Math

PHP library containing math related code used in PocketMine-MP
GNU Lesser General Public License v3.0
41 stars 20 forks source link

Remove duplicate overloaded logic #58

Closed kaozaza2 closed 2 years ago

kaozaza2 commented 3 years ago

Remove unused code

SOF3 commented 3 years ago

Ignore my approval... This is an API break. Users may want to call $vector2->add($vector2). Why would you have to stop this functionality? Do we have another function to replace this direct call?

dktapps commented 3 years ago

distanceSquared already implements the same overloaded logic.

dktapps commented 2 years ago

I'm more leaning towards getting rid of the overloaded logic entirely, rather than doing this. It's really not that difficult to do vector->distance(new Vector2(x, y)) if you want to pass two floats.

dktapps commented 2 years ago

I should also mention that Vector3 doesn't have this overloading, so there's an inconsistency to confuse developers.