Add Vector3::normalized()

Makes a copy of the vector, normalizes it, and returns it.
This commit is contained in:
Eryn Wells 2014-08-02 10:00:00 -07:00
parent c80a6e9ac7
commit d44fa4dd2a
2 changed files with 15 additions and 2 deletions

View file

@ -47,8 +47,12 @@ struct Vector3
Double dot(const Vector3 &v) const;
Vector3 cross(const Vector3 &v) const;
/** Normalize and return a reference to this vector. */
Vector3 &normalize();
/** Return a copy of this vector, normalized. Does not modify this vector. */
Vector3 normalized() const;
static const Vector3 Zero;
// Unit vectors in each of the three cartesian directions.
static const Vector3 X, Y, Z;