Added a scalar divisor operator

This commit is contained in:
2025-02-03 15:21:22 -05:00
parent cccadc5d21
commit 437d209200
2 changed files with 8 additions and 0 deletions

View File

@@ -78,6 +78,12 @@ V3D<Type> V3D<Type>::operator*(Type scalar) const
return V3D<Type>{this->x * scalar, this->y * scalar, this->z * scalar}; return V3D<Type>{this->x * scalar, this->y * scalar, this->z * scalar};
} }
template <typename Type>
V3D<Type> V3D<Type>::operator/(Type scalar) const
{
return V3D<Type>{this->x / scalar, this->y / scalar, this->z / scalar};
}
template <typename Type> template <typename Type>
V3D<Type> &V3D<Type>::operator+=(const V3D<Type> &other) V3D<Type> &V3D<Type>::operator+=(const V3D<Type> &other)
{ {

View File

@@ -26,6 +26,8 @@ public:
V3D<Type> operator*(Type scalar) const; V3D<Type> operator*(Type scalar) const;
V3D<Type> operator/(Type scalar) const;
void operator=(const V3D<Type> &other); void operator=(const V3D<Type> &other);
V3D<Type> &operator+=(const V3D<Type> &other); V3D<Type> &operator+=(const V3D<Type> &other);