YUNG-GANG / YUNGs-API

API for my Minecraft mods
GNU Lesser General Public License v3.0
22 stars 12 forks source link

Replace Mth.fastInvSqrt(Deprecated) with Mth.invSqrt #52

Closed JT122406 closed 11 months ago

JT122406 commented 1 year ago

Since Mojang added joml in 1.19.4 this method has been deprecated and replaced with invSqrt which calls org.joml.Math#invsqrt which is the correct way going forward as mojang moves to use only joml.

yungnickyoung commented 11 months ago

I see that this new method is just a wrapper for joml's Math#invsqrt, which itself is just a wrapper to java.lang.Math#sqrt. Do you know if there is a performance difference between the new method and the deprecated? Because if so, I'd prefer to reimplement fastInvSqrt rather than use the joml method.

JT122406 commented 11 months ago

The deprecated one is likely to be removed in the future as Mojang removes math classes to move to joml completely. In general JOML is faster because it runs calculations on the GPU using OpenGL

yungnickyoung commented 11 months ago

Gotcha, thanks for the help