Added CONSTANTWAVESPEED define to improve performance.