2020-03-22 00:45:04 +01:00
|
|
|
#pragma once
|
2015-09-30 02:56:11 +02:00
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
2021-01-30 07:51:39 +01:00
|
|
|
#include "SqBase.hpp"
|
2015-09-30 02:56:11 +02:00
|
|
|
|
|
|
|
// ------------------------------------------------------------------------------------------------
|
|
|
|
namespace SqMod {
|
|
|
|
|
2016-08-04 02:08:59 +02:00
|
|
|
/* ------------------------------------------------------------------------------------------------
|
2016-08-23 22:01:57 +02:00
|
|
|
* Helper constants used by the bas types.
|
2016-08-04 02:08:59 +02:00
|
|
|
*/
|
2021-01-30 07:51:39 +01:00
|
|
|
static constexpr float SQMOD_PI = 3.14159265358979323846264338327950288f;
|
|
|
|
static constexpr double SQMOD_PI64 = 3.1415926535897932384626433832795028841971693993751;
|
2016-08-04 02:08:59 +02:00
|
|
|
|
2021-01-30 07:51:39 +01:00
|
|
|
static constexpr float SQMOD_RECIPROCAL_PI = (1.0f / SQMOD_PI);
|
|
|
|
static constexpr double SQMOD_RECIPROCAL_PI64 = (1.0 / SQMOD_PI64);
|
2016-08-04 02:08:59 +02:00
|
|
|
|
2021-01-30 07:51:39 +01:00
|
|
|
static constexpr float SQMOD_HALF_PI = (SQMOD_PI * 0.5f);
|
|
|
|
static constexpr double SQMOD_HALF_PI64 = (SQMOD_PI64 * 0.5);
|
2016-08-04 02:08:59 +02:00
|
|
|
|
2021-01-30 07:51:39 +01:00
|
|
|
static constexpr float SQMOD_DEGTORAD = SQMOD_PI / 180.0f;
|
|
|
|
static constexpr double SQMOD_DEGTORAD64 = SQMOD_PI64 / 180.0;
|
2016-08-04 02:08:59 +02:00
|
|
|
|
2021-01-30 07:51:39 +01:00
|
|
|
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
|
2016-08-23 22:01:57 +02:00
|
|
|
|
2021-01-30 07:51:39 +01:00
|
|
|
static constexpr float SQMOD_RADTODEG = 1.0f / SQMOD_DEGTORAD;
|
|
|
|
static constexpr double SQMOD_RADTODEG64 = 1.0 / SQMOD_DEGTORAD64;
|
2016-08-04 02:08:59 +02:00
|
|
|
|
2016-11-13 07:32:04 +01:00
|
|
|
/* ------------------------------------------------------------------------------------------------
|
|
|
|
* Intersection test result.
|
|
|
|
*/
|
|
|
|
enum Intersection
|
|
|
|
{
|
|
|
|
SQMODI_OUTSIDE = 0,
|
|
|
|
SQMODI_INTERSECTS,
|
|
|
|
SQMODI_INSIDE,
|
|
|
|
};
|
|
|
|
|
2016-03-10 04:57:13 +01:00
|
|
|
/* ------------------------------------------------------------------------------------------------
|
|
|
|
* Obtain a randomly chosen color from a list of known colors.
|
|
|
|
*/
|
2021-01-30 07:51:39 +01:00
|
|
|
SQMOD_NODISCARD const Color3 & GetRandomColor();
|
2015-09-30 02:56:11 +02:00
|
|
|
|
|
|
|
/* ------------------------------------------------------------------------------------------------
|
2016-03-10 04:57:13 +01:00
|
|
|
* Attempt to identify the color in the specified name and return it.
|
2015-09-30 02:56:11 +02:00
|
|
|
*/
|
2021-01-30 07:51:39 +01:00
|
|
|
SQMOD_NODISCARD Color3 GetColorStr(const SQChar * name);
|
2016-11-16 15:19:29 +01:00
|
|
|
|
|
|
|
/* ------------------------------------------------------------------------------------------------
|
|
|
|
* Attempt to identify the color in the specified name and return it.
|
|
|
|
*/
|
2021-01-30 07:51:39 +01:00
|
|
|
SQMOD_NODISCARD Color3 GetColor(StackStrF & name);
|
2020-09-06 22:54:28 +02:00
|
|
|
|
2015-09-30 02:56:11 +02:00
|
|
|
} // Namespace:: SqMod
|