Added OpenGL-like Vector constructors

Former-commit-id: 302389b6a915d66a0a0fb4cc9a748ed5266ae98c
This commit is contained in:
Lynix
2015-01-05 02:32:57 +01:00
parent 0d143a64a2
commit 5daf09e41b
6 changed files with 163 additions and 8 deletions

View File

@@ -36,6 +36,18 @@ NzVector2<T>::NzVector2(const NzVector2<U>& vec)
Set(vec);
}
template<typename T>
NzVector2<T>::NzVector2(const NzVector3<T>& vec)
{
Set(vec);
}
template<typename T>
NzVector2<T>::NzVector2(const NzVector4<T>& vec)
{
Set(vec);
}
template<typename T>
T NzVector2<T>::AbsDotProduct(const NzVector2& vec) const
{
@@ -208,6 +220,24 @@ NzVector2<T>& NzVector2<T>::Set(const NzVector2<U>& vec)
return *this;
}
template<typename T>
NzVector2<T>& NzVector2<T>::Set(const NzVector3<T>& vec)
{
x = vec.x;
y = vec.y;
return *this;
}
template<typename T>
NzVector2<T>& NzVector2<T>::Set(const NzVector4<T>& vec)
{
x = vec.x;
y = vec.y;
return *this;
}
template<typename T>
T NzVector2<T>::SquaredDistance(const NzVector2& vec) const
{