Add Constructor with TVector3 and a Real w.

This commit is contained in:
THoehne 2024-10-02 14:19:03 +02:00
parent 7814922931
commit 2f84387b1a
2 changed files with 14 additions and 0 deletions

View File

@ -8,6 +8,7 @@
#include "Core/public/Math/Vector2.hpp" #include "Core/public/Math/Vector2.hpp"
#include "Core/public/Math/Vector3.hpp"
#define PZeroVector4(type, aligned) Phanes::Core::Math::TVector4<##type, ##aligned>(0,0,0,0) #define PZeroVector4(type, aligned) Phanes::Core::Math::TVector4<##type, ##aligned>(0,0,0,0)
@ -86,6 +87,13 @@ namespace Phanes::Core::Math
/// <param name="v2">TVector2 two</param> /// <param name="v2">TVector2 two</param>
TVector4(const TVector2<Real, S>& v1, const TVector2<Real, S>& v2); TVector4(const TVector2<Real, S>& v1, const TVector2<Real, S>& v2);
/// <summary>
/// Construct vector from 3d vector (x,y,z) and w
/// </summary>
/// <param name="v1">TVector3</param>
/// <param name="w">W</param>
TVector4(const TVector3<Real, S>& v1, Real w);
/// <summary> /// <summary>
/// Construct vector from array of components /// Construct vector from array of components
/// </summary> /// </summary>

View File

@ -35,6 +35,12 @@ namespace Phanes::Core::Math
Detail::construct_vec4<T, S>::map(*this, comp); Detail::construct_vec4<T, S>::map(*this, comp);
} }
template<RealType T, bool S>
Phanes::Core::Math::TVector4<T, S>::TVector4(const TVector3<T, S>& v, T w)
{
Detail::construct_vec4<T, S>::map(*this, v, w);
}
template<RealType T, bool S> template<RealType T, bool S>
TVector4<T, S>& operator+=(TVector4<T, S>& v1, const TVector4<T, S>& v2) TVector4<T, S>& operator+=(TVector4<T, S>& v1, const TVector4<T, S>& v2)