Cleanup updateCameraDirection and fix random input not working
Fix endian.h include for FreeBSD