deltaluca / nape

Haxe/AS3 Physics Engine
http://napephys.com
Other
542 stars 78 forks source link

Trying to add Fixed16 in Nape to have consistency between PCs. (Haxe) #112

Open jinjinjinK opened 6 years ago

jinjinjinK commented 6 years ago

Hello Luca, Sorry to add this here, but I don't know how to reach you. I'm trying to add Fixed points numbers in Nape because I need consistency in my multiplayer game. As I use a deterministic lockstep system for online play it is a necessity. I read that at some point you were thinking to add Fixed16 to Nape, I would be interested to know if you did ? I thought I would ask before starting. If you didn't, do you have any advice on how to implement it properly ? If I just replace Float with Fixed16, I should probably revert the result back to float to have the correct value ? Like in this test var f:Float = 2.0 - 1.1; trace(f); // 0.9 var fixed:Fixed16 = 2.0 -1.1; trace(fixed); //58982 trace(fixed.tof()); //0,899993896484375

Or should I do it manually, case by case for every calcul in all Haxe classes ?