first commit of some basics
This commit is contained in:
27
TSE_Math/src/MathF.hpp
Normal file
27
TSE_Math/src/MathF.hpp
Normal file
@@ -0,0 +1,27 @@
|
||||
#pragma once
|
||||
|
||||
#include "Types.hpp"
|
||||
|
||||
namespace TSE
|
||||
{
|
||||
|
||||
/// @brief definition of PI for the engine
|
||||
constexpr float TSE_PI = 3.14159265358979323846f;
|
||||
|
||||
/// @brief the epsilon used as min float value for comparisons in the engine
|
||||
constexpr float TSE_EPSILON = 1e-6f;
|
||||
|
||||
/// @brief a simple degrees to radiant conversion function
|
||||
/// @param deg the degrees value
|
||||
/// @return the radiant value
|
||||
inline float Deg2Rad(const float& deg) {
|
||||
return deg * (TSE_PI / 180.0f);
|
||||
}
|
||||
|
||||
/// @brief a simple radiant to degrees conversion function
|
||||
/// @param rad the radiant value
|
||||
/// @return the degrees value
|
||||
inline float Rad2Deg( const float& rad) {
|
||||
return rad * (180.0f / TSE_PI);
|
||||
}
|
||||
} // namespace TSE
|
||||
Reference in New Issue
Block a user