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

Bogus return value for Vector3->normalize() when length is zero #67

Open dktapps opened 2 years ago

dktapps commented 2 years ago

A zero vector cannot be normalized. Returning a zero vector for normalized zero vector is unexpected and creates interesting bugs (so far, this has usually been seen in conjuction with NAN for yaw/pitch in PocketMine-MP).

An exception should be thrown in this case instead.