pmmp / Math

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

Add function Math::lerp, Vector3::lerp and Vector2::lerp #7

Closed fuyutsuki closed 5 years ago

fuyutsuki commented 5 years ago

Theory: https://en.wikipedia.org/wiki/Linear_interpolation

fuyutsuki commented 5 years ago

It appears that the functions ought to be static.

I decided that it is not necessary to make static because Vector3 and Vector2 functions are not static, but should it still be static?

wait... ok

dktapps commented 5 years ago

In their current form they make no sense. (new Vector3())->lerp(new Vector3(0, 0, 0), new Vector3(1, 1, 1), 0.5)

fuyutsuki commented 5 years ago

I made some strange mistake lol

dktapps commented 5 years ago

please refer to the discussion on #6

dktapps commented 5 years ago

oops, I meant to refer to #5 ... the point being that a lot of these functions don't make sense as-is.

fuyutsuki commented 5 years ago

You mean it should be static?

dktapps commented 5 years ago

yes

fuyutsuki commented 5 years ago

Is there anything else I should change?

dktapps commented 5 years ago

@pmmp/developers can I get a second pair of eyes on this?

fuyutsuki commented 5 years ago

I will recreate this when issue #3 and #4 is solved