mirror of
https://github.com/thunderbrewhq/typhoon.git
synced 2025-12-12 02:22:30 +00:00
feat(vector): add operator+ for C3Vector and C3Vector
This commit is contained in:
parent
4278157faf
commit
ee4612182a
3 changed files with 21 additions and 0 deletions
|
|
@ -20,3 +20,11 @@ void C3Vector::Normalize() {
|
|||
float C3Vector::SquaredMag() const {
|
||||
return this->x * this->x + this->y * this->y + this->z * this->z;
|
||||
}
|
||||
|
||||
C3Vector operator+(const C3Vector& l, const C3Vector& r) {
|
||||
float x = l.x + r.x;
|
||||
float y = l.y + r.y;
|
||||
float z = l.z + r.z;
|
||||
|
||||
return { x, y, z };
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue