Hello!
I just learnt about the "Quake" trick for calculating inverse square roots quickly. Nicholas wrote a
great article on it back in 2008. Does anyone know how I can implement it in Haxe for the cpp target?
Nicholas showed how to do it for the Flash target. But there are four lines that rely on a Flash-only class called Flash.memory:
flash.Memory.setFloat(0,x);
var i = flash.Memory.getI32(0);
...
flash.Memory.setI32(0,i);
x = flash.Memory.getFloat(0);
Is there similar code for the cpp target? Can I just use the corresponding methods in haxe.io.Bytes? If so, will the method still be substantially faster than Math.sqrt()?
I've searched, but I haven't been able to find code anywhere.
Thanks!
Damian.