Implement a bunch of the useful Vector operations
This commit is contained in:
parent
9b076f1533
commit
fa3708edfb
2 changed files with 65 additions and 0 deletions
|
@ -28,8 +28,27 @@ struct Vector4
|
|||
Double& X();
|
||||
Double& Y();
|
||||
Double& Z();
|
||||
|
||||
/** Get the length-squared of this vector. */
|
||||
Double Length2() const;
|
||||
|
||||
/** Get the length of this vector. */
|
||||
Double Length() const;
|
||||
|
||||
/** Get the dot product of `this` and `rhs`. */
|
||||
Double Dot(const Vector4& rhs) const;
|
||||
|
||||
/** Get the cross product of `this` and `rhs`. */
|
||||
Vector4 Cross(const Vector4& rhs) const;
|
||||
|
||||
/** Normalize this vector. */
|
||||
Vector4& Normalize();
|
||||
};
|
||||
|
||||
|
||||
/** Normalize the given vector and return a copy of it. */
|
||||
Vector4& Normalized(const Vector4& v);
|
||||
|
||||
} /* namespace basics */
|
||||
} /* namespace charles */
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue