diff --git a/Engine/Source/Runtime/Core/public/Math/Vector4.hpp b/Engine/Source/Runtime/Core/public/Math/Vector4.hpp index 2a76a15..8f7404f 100644 --- a/Engine/Source/Runtime/Core/public/Math/Vector4.hpp +++ b/Engine/Source/Runtime/Core/public/Math/Vector4.hpp @@ -8,6 +8,7 @@ #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) @@ -86,6 +87,13 @@ namespace Phanes::Core::Math /// <param name="v2">TVector2 two</param> 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> /// Construct vector from array of components /// </summary> diff --git a/Engine/Source/Runtime/Core/public/Math/Vector4.inl b/Engine/Source/Runtime/Core/public/Math/Vector4.inl index b6c8e32..728160a 100644 --- a/Engine/Source/Runtime/Core/public/Math/Vector4.inl +++ b/Engine/Source/Runtime/Core/public/Math/Vector4.inl @@ -35,6 +35,12 @@ namespace Phanes::Core::Math 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> TVector4<T, S>& operator+=(TVector4<T, S>& v1, const TVector4<T, S>& v2)