mirror of
https://github.com/thunderbrewhq/typhoon.git
synced 2025-12-12 02:22:30 +00:00
feat(vector): add C3Vector::Normalize
This commit is contained in:
parent
e38af58adb
commit
4278157faf
3 changed files with 23 additions and 0 deletions
|
|
@ -13,6 +13,10 @@ float C3Vector::Mag() const {
|
|||
return CMath::sqrt(this->SquaredMag());
|
||||
}
|
||||
|
||||
void C3Vector::Normalize() {
|
||||
this->operator*=(1.0f / this->Mag());
|
||||
}
|
||||
|
||||
float C3Vector::SquaredMag() const {
|
||||
return this->x * this->x + this->y * this->y + this->z * this->z;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue