Modified quaternion mat3_cast for faster results

- Make method more cache coherent
- Reduce number of multiplications