Add Vector3::normalized()
Makes a copy of the vector, normalizes it, and returns it.
This commit is contained in:
parent
c80a6e9ac7
commit
d44fa4dd2a
2 changed files with 15 additions and 2 deletions
|
@ -220,8 +220,6 @@ Vector3::cross(const Vector3 &v)
|
|||
|
||||
/*
|
||||
* Vector3::normalize --
|
||||
*
|
||||
* Normalize this vector in place. That is, make this vector's magnitude (length) 1.0.
|
||||
*/
|
||||
Vector3 &
|
||||
Vector3::normalize()
|
||||
|
@ -231,6 +229,17 @@ Vector3::normalize()
|
|||
}
|
||||
|
||||
|
||||
/*
|
||||
* Vector3::normalized --
|
||||
*/
|
||||
Vector3
|
||||
Vector3::normalized()
|
||||
const
|
||||
{
|
||||
return *this / length();
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* operator* --
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue