Reintroduce Vector comparison operator
Since it can be used for integer vector, also fixed comparison technique. Former-commit-id: 3a193ed21beb4d9b7d311eb29bc2852b0776a41c
This commit is contained in:
@@ -414,6 +414,33 @@ bool NzVector2<T>::operator!=(const NzVector2& vec) const
|
||||
return !operator==(vec);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
bool NzVector2<T>::operator<(const NzVector2& vec) const
|
||||
{
|
||||
if (x == vec.x)
|
||||
return y < vec.y;
|
||||
else
|
||||
return x < vec.x;
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
bool NzVector2<T>::operator<=(const NzVector2& vec) const
|
||||
{
|
||||
return operator<(vec) || operator==(vec);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
bool NzVector2<T>::operator>(const NzVector2& vec) const
|
||||
{
|
||||
return !operator<=(vec);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
bool NzVector2<T>::operator>=(const NzVector2& vec) const
|
||||
{
|
||||
return !operator<(vec);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
NzVector2<T> NzVector2<T>::Lerp(const NzVector2& from, const NzVector2& to, T interpolation)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user