Skip to content

Commit

Permalink
MathLib: added ValueType parameter to Vector, Matrix and Quaternion t…
Browse files Browse the repository at this point in the history
…ypes
  • Loading branch information
TheMostDiligent committed Dec 15, 2023
1 parent 7cb52f6 commit c6879ef
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Common/interface/BasicMath.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ template <class T> struct Vector4;

template <class T> struct Vector2
{
using ValueType = T;

union
{
struct
Expand Down Expand Up @@ -268,6 +270,8 @@ constexpr Vector2<T> operator*(T s, const Vector2<T>& a)

template <class T> struct Vector3
{
using ValueType = T;

union
{
struct
Expand Down Expand Up @@ -490,6 +494,8 @@ constexpr Vector3<T> operator*(T s, const Vector3<T>& a)

template <class T> struct Vector4
{
using ValueType = T;

union
{
struct
Expand Down Expand Up @@ -731,6 +737,8 @@ constexpr Vector4<T> operator*(T s, const Vector4<T>& a)

template <class T> struct Matrix2x2
{
using ValueType = T;

union
{
struct
Expand Down Expand Up @@ -997,6 +1005,8 @@ inline constexpr Matrix2x2<T> operator/(const Matrix2x2<T>& Mat, T s)

template <class T> struct Matrix3x3
{
using ValueType = T;

union
{
struct
Expand Down Expand Up @@ -1355,6 +1365,8 @@ inline constexpr Matrix3x3<T> operator/(const Matrix3x3<T>& Mat, T s)

template <class T> struct Matrix4x4
{
using ValueType = T;

union
{
struct
Expand Down Expand Up @@ -2276,6 +2288,8 @@ using int2x2 = Matrix2x2<Int32>;
template <typename T = float>
struct Quaternion
{
using ValueType = T;

Vector4<T> q{0, 0, 0, 1};

constexpr Quaternion(const Vector4<T>& _q) noexcept :
Expand Down

0 comments on commit c6879ef

Please sign in to comment.