35 lines
729 B
C++
35 lines
729 B
C++
|
|
#pragma once
|
||
|
|
#include <stdexcept>
|
||
|
|
|
||
|
|
namespace Basalt::Shared::Math {
|
||
|
|
|
||
|
|
using FloatPoint = float;
|
||
|
|
|
||
|
|
struct Vector3 {
|
||
|
|
FloatPoint x, y, z;
|
||
|
|
};
|
||
|
|
struct Vector4 {
|
||
|
|
FloatPoint x, y, z, w;
|
||
|
|
};
|
||
|
|
struct Matrix4x4 {
|
||
|
|
Vector4 data[4];
|
||
|
|
};
|
||
|
|
|
||
|
|
//template<typename TEle, size_t VCnt>
|
||
|
|
// requires(std::integral<TEle> || std::floating_point<TEle>)
|
||
|
|
//struct Vector {
|
||
|
|
// TEle factor[VCnt];
|
||
|
|
//};
|
||
|
|
|
||
|
|
#define NOT_IMPLEMENTED throw std::logic_error("not implemented function");
|
||
|
|
|
||
|
|
template<typename TNum, typename TVec>
|
||
|
|
struct Vector3Traits {};
|
||
|
|
|
||
|
|
template<typename TNum, typename TMat>
|
||
|
|
struct Matrix4x4Traits {};
|
||
|
|
|
||
|
|
#undef NOT_IMPLEMENTED
|
||
|
|
|
||
|
|
} // namespace Basalt::Shared::Math
|