Refactored the math code for camera motion control in the editor.
Fixed a bug that sometimes the duration between two keyframes does not consider loop dwell time.