moved math-specific stuff to separate header
pulled camera updates out of per-frame loop