mirror of
https://github.com/VCMP-SqMod/SqMod.git
synced 2024-11-08 08:47:17 +01:00
4a6bfc086c
Switched to POCO library for unified platform/library interface. Deprecated the external module API. It was creating more problems than solving. Removed most built-in libraries in favor of system libraries for easier maintenance. Cleaned and secured code with help from static analyzers.
56 lines
2.1 KiB
C++
56 lines
2.1 KiB
C++
#pragma once
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
#include "SqBase.hpp"
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
namespace SqMod {
|
|
|
|
/* ------------------------------------------------------------------------------------------------
|
|
* Helper constants used by the bas types.
|
|
*/
|
|
static constexpr float SQMOD_PI = 3.14159265358979323846264338327950288f;
|
|
static constexpr double SQMOD_PI64 = 3.1415926535897932384626433832795028841971693993751;
|
|
|
|
static constexpr float SQMOD_RECIPROCAL_PI = (1.0f / SQMOD_PI);
|
|
static constexpr double SQMOD_RECIPROCAL_PI64 = (1.0 / SQMOD_PI64);
|
|
|
|
static constexpr float SQMOD_HALF_PI = (SQMOD_PI * 0.5f);
|
|
static constexpr double SQMOD_HALF_PI64 = (SQMOD_PI64 * 0.5);
|
|
|
|
static constexpr float SQMOD_DEGTORAD = SQMOD_PI / 180.0f;
|
|
static constexpr double SQMOD_DEGTORAD64 = SQMOD_PI64 / 180.0;
|
|
|
|
static constexpr float SQMOD_DEGTORAD_2 = SQMOD_PI / 360.0f; // M_DEGTORAD / 2.f
|
|
static constexpr double SQMOD_DEGTORAD64_2 = SQMOD_PI64 / 360.0; // M_DEGTORAD / 2.f
|
|
|
|
static constexpr float SQMOD_RADTODEG = 1.0f / SQMOD_DEGTORAD;
|
|
static constexpr double SQMOD_RADTODEG64 = 1.0 / SQMOD_DEGTORAD64;
|
|
|
|
/* ------------------------------------------------------------------------------------------------
|
|
* Intersection test result.
|
|
*/
|
|
enum Intersection
|
|
{
|
|
SQMODI_OUTSIDE = 0,
|
|
SQMODI_INTERSECTS,
|
|
SQMODI_INSIDE,
|
|
};
|
|
|
|
/* ------------------------------------------------------------------------------------------------
|
|
* Obtain a randomly chosen color from a list of known colors.
|
|
*/
|
|
SQMOD_NODISCARD const Color3 & GetRandomColor();
|
|
|
|
/* ------------------------------------------------------------------------------------------------
|
|
* Attempt to identify the color in the specified name and return it.
|
|
*/
|
|
SQMOD_NODISCARD Color3 GetColorStr(const SQChar * name);
|
|
|
|
/* ------------------------------------------------------------------------------------------------
|
|
* Attempt to identify the color in the specified name and return it.
|
|
*/
|
|
SQMOD_NODISCARD Color3 GetColor(StackStrF & name);
|
|
|
|
} // Namespace:: SqMod
|