Created
September 12, 2016 14:14
-
-
Save kravchik/2eedaf0651edfe06c544ef338ea01776 to your computer and use it in GitHub Desktop.
Another test of optimizer
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public float getProj(O4Obj mdA, O4Obj mdB) { | |
return mdA.pos.sub(mdB.pos).normalized().complexDiv1(mdA.impulse).x / mdA.mass; | |
} | |
float getProjOptimized(O4Obj mdA, O4Obj mdB) { | |
float newVar_4_x = (mdA.pos.x - mdB.pos.x); | |
float newVar_4_y = (mdA.pos.y - mdB.pos.y); | |
float forPare_42 = STANDARD.sqrt((newVar_4_x * newVar_4_x + newVar_4_y * newVar_4_y)); | |
float newVar_3_x = newVar_4_x / forPare_42; | |
float newVar_3_y = newVar_4_y / forPare_42; | |
float newVar_2_x = (newVar_3_x * mdA.impulse.x + newVar_3_y * mdA.impulse.y); | |
return newVar_2_x / mdA.mass; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment