starting to fix compilation issues

This commit is contained in:
Kbz-8
2024-09-02 13:36:02 +02:00
parent b7d554553b
commit 1b996af83f
29 changed files with 77 additions and 132 deletions

View File

@@ -1,11 +1,9 @@
#ifndef __SCOP_ANGLES__
#define __SCOP_ANGLES__
#ifndef __MLX_ANGLES__
#define __MLX_ANGLES__
#include <Maths/Enums.h>
#include <utility>
#include <string>
namespace Scop
namespace mlx
{
template<typename T> struct EulerAngles;
template<typename T> struct Quat;

View File

@@ -1,13 +1,10 @@
#pragma once
#include <Maths/Angles.h>
#include <algorithm>
#include <sstream>
#include <Maths/Constants.h>
#include <Maths/MathsUtils.h>
namespace Scop
namespace mlx
{
namespace Internal
{

View File

@@ -1,11 +1,7 @@
#ifndef __SCOP_MATHS_CONSTANTS__
#define __SCOP_MATHS_CONSTANTS__
#ifndef __MLX_MATHS_CONSTANTS__
#define __MLX_MATHS_CONSTANTS__
#include <climits>
#include <limits>
#include <type_traits>
namespace Scop
namespace mlx
{
template<typename T> constexpr std::size_t BitCount = CHAR_BIT * sizeof(T);

View File

@@ -1,9 +1,7 @@
#ifndef __SCOPE_MATHS_ENUMS__
#define __SCOPE_MATHS_ENUMS__
#ifndef __MLX_MATHS_ENUMS__
#define __MLX_MATHS_ENUMS__
#include <cstddef>
namespace Scop
namespace mlx
{
enum class AngleUnit
{

View File

@@ -1,11 +1,9 @@
#ifndef __SCOP_EULER_ANGLES__
#define __SCOP_EULER_ANGLES__
#include <string>
#ifndef __MLX_EULER_ANGLES__
#define __MLX_EULER_ANGLES__
#include <Maths/Angles.h>
namespace Scop
namespace mlx
{
template<typename T>
struct EulerAngles

View File

@@ -1,7 +1,7 @@
#pragma once
#include <Maths/EulerAngles.h>
namespace Scop
namespace mlx
{
template<typename T>
constexpr EulerAngles<T>::EulerAngles(DegreeAngle<T> P, DegreeAngle<T> Y, DegreeAngle<T> R) :

View File

@@ -1,13 +1,9 @@
#ifndef __SCOP_MAT4__
#define __SCOP_MAT4__
#include <cstddef>
#include <limits>
#include <string>
#ifndef __MLX_MAT4__
#define __MLX_MAT4__
#include <Maths/Angles.h>
namespace Scop
namespace mlx
{
template<typename T> struct Vec2;
template<typename T> struct Vec3;

View File

@@ -1,7 +1,6 @@
#pragma once
#include <Maths/Mat4.h>
#include <Core/Logs.h>
#include <Maths/EulerAngles.h>
#include <Maths/Quaternions.h>
#include <Maths/Vec2.h>
@@ -9,10 +8,7 @@
#include <Maths/Vec4.h>
#include <Maths/MathsUtils.h>
#include <cstring>
#include <sstream>
namespace Scop
namespace mlx
{
template<typename T>
constexpr Mat4<T>::Mat4(T r11, T r12, T r13, T r14,

View File

@@ -1,9 +1,7 @@
#ifndef __SCOP_MATHS_UTILS__
#define __SCOP_MATHS_UTILS__
#ifndef __MLX_MATHS_UTILS__
#define __MLX_MATHS_UTILS__
#include <concepts>
namespace Scop
namespace mlx
{
template<typename T>
[[nodiscard]] constexpr T Mod(T x, T y) noexcept;

View File

@@ -1,12 +1,9 @@
#pragma once
#include <Maths/MathsUtils.h>
#include <type_traits>
#include <cmath>
#include <Maths/Constants.h>
namespace Scop
namespace mlx
{
template<typename T>
[[nodiscard]] constexpr T Mod(T x, T y) noexcept

View File

@@ -1,10 +1,10 @@
#ifndef __SCOP_QUATERNIONS__
#define __SCOP_QUATERNIONS__
#ifndef __MLX_QUATERNIONS__
#define __MLX_QUATERNIONS__
#include <Maths/Angles.h>
#include <Maths/Vec3.h>
namespace Scop
namespace mlx
{
template<typename T>
struct Quat

View File

@@ -1,7 +1,7 @@
#pragma once
#include <Maths/Quaternions.h>
namespace Scop
namespace mlx
{
template<typename T>
constexpr Quat<T>::Quat(T W, T X, T Y, T Z) : w(W), x(X), y(Y), z(Z)
@@ -46,7 +46,7 @@ namespace Scop
RadianAngle<T> Quat<T>::AngleBetween(const Quat& quat) const
{
T alpha = Vec3<T>::DotProduct(Vec3<T>(x, y, z), Vec3<T>(quat.x, quat.y, quat.z));
return std::acos(Scop::Clamp(alpha, T(-1.0), T(1.0)));
return std::acos(mlx::Clamp(alpha, T(-1.0), T(1.0)));
}
template<typename T>
@@ -366,10 +366,10 @@ namespace Scop
constexpr Quat<T> Quat<T>::Lerp(const Quat& from, const Quat& to, T interpolation)
{
Quat interpolated;
interpolated.w = Scop::Lerp(from.w, to.w, interpolation);
interpolated.x = Scop::Lerp(from.x, to.x, interpolation);
interpolated.y = Scop::Lerp(from.y, to.y, interpolation);
interpolated.z = Scop::Lerp(from.z, to.z, interpolation);
interpolated.w = mlx::Lerp(from.w, to.w, interpolation);
interpolated.x = mlx::Lerp(from.x, to.x, interpolation);
interpolated.y = mlx::Lerp(from.y, to.y, interpolation);
interpolated.z = mlx::Lerp(from.z, to.z, interpolation);
return interpolated;
}

View File

@@ -1,17 +1,10 @@
#ifndef __SCOP_VEC2__
#define __SCOP_VEC2__
#ifndef __MLX_VEC2__
#define __MLX_VEC2__
#include <string>
#include <limits>
#include <cstdint>
#include <cmath>
#include <Core/Logs.h>
namespace Scop
namespace mlx
{
template <typename T> class Vec3;
template <typename T> class Vec4;
template <typename T> struct Vec3;
template <typename T> struct Vec4;
template <typename T>
struct Vec2

View File

@@ -1,8 +1,7 @@
#pragma once
#include <Maths/Vec2.h>
namespace Scop
namespace mlx
{
template<typename T>
constexpr Vec2<T>::Vec2(T X, T Y) : x(X), y(Y) {}
@@ -116,14 +115,14 @@ namespace Scop
template<typename T>
constexpr T& Vec2<T>::operator[](std::size_t i)
{
Scop::Assert(i < 2, "index out of range");
mlx::Assert(i < 2, "index out of range");
return *(&x + i);
}
template<typename T>
constexpr T Vec2<T>::operator[](std::size_t i) const
{
Scop::Assert(i < 2, "index out of range");
mlx::Assert(i < 2, "index out of range");
return *(&x + i);
}

View File

@@ -1,17 +1,10 @@
#ifndef __SCOP_VEC3__
#define __SCOP_VEC3__
#ifndef __MLX_VEC3__
#define __MLX_VEC3__
#include <string>
#include <limits>
#include <cstdint>
#include <cmath>
#include <Core/Logs.h>
namespace Scop
namespace mlx
{
template<typename T> class Vec2;
template<typename T> class Vec4;
template<typename T> struct Vec2;
template<typename T> struct Vec4;
template<typename T>
struct Vec3

View File

@@ -1,8 +1,7 @@
#pragma once
#include <Maths/Vec3.h>
namespace Scop
namespace mlx
{
template<typename T>
constexpr Vec3<T>::Vec3(T X, T Y, T Z) : x(X), y(Y), z(Z) {}
@@ -145,14 +144,14 @@ namespace Scop
template<typename T>
constexpr T& Vec3<T>::operator[](std::size_t i)
{
Scop::Assert(i < 3, "index out of range");
mlx::Assert(i < 3, "index out of range");
return *(&x + i);
}
template<typename T>
constexpr const T& Vec3<T>::operator[](std::size_t i) const
{
Scop::Assert(i < 3, "index out of range");
mlx::Assert(i < 3, "index out of range");
return *(&x + i);
}

View File

@@ -1,17 +1,10 @@
#ifndef __SCOP_VEC4__
#define __SCOP_VEC4__
#ifndef __MLX_VEC4__
#define __MLX_VEC4__
#include <string>
#include <limits>
#include <cstdint>
#include <cmath>
#include <Core/Logs.h>
namespace Scop
namespace mlx
{
template<typename T> class Vec2;
template<typename T> class Vec3;
template<typename T> struct Vec2;
template<typename T> struct Vec3;
template<typename T>
struct Vec4

View File

@@ -1,8 +1,7 @@
#pragma once
#include <Maths/Vec4.h>
namespace Scop
namespace mlx
{
template<typename T>
constexpr Vec4<T>::Vec4(T X, T Y, T Z, T W) : x(X), y(Y), z(Z), w(W) {}
@@ -120,14 +119,14 @@ namespace Scop
template<typename T>
constexpr T& Vec4<T>::operator[](std::size_t i)
{
Scop::Assert(i < 4, "index out of range");
mlx::Assert(i < 4, "index out of range");
return *(&x + i);
}
template<typename T>
constexpr const T& Vec4<T>::operator[](std::size_t i) const
{
Scop::Assert(i < 4, "index out of range");
mlx::Assert(i < 4, "index out of range");
return *(&x + i);
}