Simplyfing and improving updatePolyVoxGeometry()
This commit is contained in:
parent
f060898986
commit
5791919f01
@ -40,6 +40,8 @@ namespace PolyVox
|
||||
Vector<Size,Type>& operator=(const Vector<Size,Type>& rhs) throw();
|
||||
///Equality Operator.
|
||||
bool operator==(const Vector<Size,Type>& rhs) const throw();
|
||||
///Comparison Operator.
|
||||
bool operator<(const Vector<Size,Type>& rhs) const throw();
|
||||
///Addition and Assignment Operator.
|
||||
Vector<Size,Type>& operator+=(const Vector<Size,Type> &rhs) throw();
|
||||
///Subtraction and Assignment Operator.
|
||||
|
@ -155,6 +155,26 @@ namespace PolyVox
|
||||
return equal;
|
||||
}
|
||||
|
||||
/**
|
||||
Checks whether this vector is less than the parameter. The metric is
|
||||
meaningless but it allows Vectors to me used as key in sdt::map, etc.
|
||||
\param rhs The Vector to compare to.
|
||||
\return true if this is less than the parameter
|
||||
\see operator!=
|
||||
*/
|
||||
template <boost::uint32_t Size, typename Type>
|
||||
inline bool Vector<Size, Type>::operator<(const Vector<Size, Type> &rhs) const throw()
|
||||
{
|
||||
for(int ct = 0; ct < Size; ++ct)
|
||||
{
|
||||
if (m_tElements[ct] < rhs.m_tElements[ct])
|
||||
return true;
|
||||
if (rhs.m_tElements[ct] < m_tElements[ct])
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
Subtraction operator subtracts corresponding elements of one Vector from the other.
|
||||
\param rhs Vector to subtract
|
||||
|
Loading…
x
Reference in New Issue
Block a user