jmorton06 / Lumos

Cross-Platform C++ 2D/3D game engine
MIT License
1.29k stars 140 forks source link

Made math constants constexpr instead of const #128

Closed adriengivry closed 11 months ago

adriengivry commented 11 months ago

Describe the issue (if no issue has been made)

Math constants are declared using the const keyword, but it doesn't guarantee that no memory will be allocated for them. To speed up operations, defining these constants as constexpr ensures the fastest possible access to them during runtime.

I also updated (float)HUGE_VAL to use std::numeric_limits<float>::infinity(), which provides better cross-platform guarantee of its value.