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

@@ -17,6 +17,12 @@ NzVector3<T>::NzVector3(T X, T Y, T Z)
Set(X, Y, Z);
}
template<typename T>
NzVector3<T>::NzVector3(T X, const NzVector2<T>& vec)
{
Set(X, vec);
}
template<typename T>
NzVector3<T>::NzVector3(T scale)
{
@@ -42,6 +48,12 @@ NzVector3<T>::NzVector3(const NzVector3<U>& vec)
Set(vec);
}
template<typename T>
NzVector3<T>::NzVector3(const NzVector4<T>& vec)
{
Set(vec);
}
template<typename T>
T NzVector3<T>::AbsDotProduct(const NzVector3& vec) const
{
@@ -255,6 +267,16 @@ NzVector3<T>& NzVector3<T>::Set(T X, T Y, T Z)
return *this;
}
template<typename T>
NzVector3<T>& NzVector3<T>::Set(T X, const NzVector2<T>& vec)
{
x = X;
y = vec.x;
z = vec.y;
return *this;
}
template<typename T>
NzVector3<T>& NzVector3<T>::Set(T scale)
{
@@ -302,6 +324,16 @@ NzVector3<T>& NzVector3<T>::Set(const NzVector3<U>& vec)
return *this;
}
template<typename T>
NzVector3<T>& NzVector3<T>::Set(const NzVector4<T>& vec)
{
x = vec.x;
y = vec.y;
z = vec.z;
return *this;
}
template<typename T>
T NzVector3<T>::SquaredDistance(const NzVector3& vec) const
{