Inlining math function
Fixing camera movement race-condition