Math/Vector3: Add GetAbs method
This commit is contained in:
@@ -179,6 +179,16 @@ namespace Nz
|
||||
return x * vec.x + y * vec.y + z * vec.z;
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Returns the absolute of this vector, ie: Vector3(abs(x), abs(y), abs(z))
|
||||
* \return The absolute of this vector
|
||||
*/
|
||||
template<typename T>
|
||||
Vector3<T> Vector3<T>::GetAbs() const
|
||||
{
|
||||
return Vector3(std::abs(x), std::abs(y), std::abs(z));
|
||||
}
|
||||
|
||||
/*!
|
||||
* \brief Calculates the length (magnitude) of the vector
|
||||
* \return The length of the vector
|
||||
|
||||
Reference in New Issue
Block a user