more versions of vec operators
parent
f96e74902a
commit
5cf1c9feff
|
@ -90,21 +90,41 @@ inline Vec2<T> operator+(const Vec2<T> &a, const Vec2<T> &b) {
|
|||
return Vec2<T>(a).add(b);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline Vec2<T> operator+(const Vec2<T> &a, T b) {
|
||||
return Vec2<T>(a).add(b);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline Vec2<T> operator-(const Vec2<T> &a, const Vec2<T> &b) {
|
||||
return Vec2<T>(a).sub(b);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline Vec2<T> operator-(const Vec2<T> &a, T b) {
|
||||
return Vec2<T>(a).sub(b);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline Vec2<T> operator*(const Vec2<T> &a, const Vec2<T> &b) {
|
||||
return Vec2<T>(a).mul(b);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline Vec2<T> operator*(const Vec2<T> &a, T b) {
|
||||
return Vec2<T>(a).mul(b);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline Vec2<T> operator/(const Vec2<T> &a, const Vec2<T> &b) {
|
||||
return Vec2<T>(a).div(b);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline Vec2<T> operator/(const Vec2<T> &a, T b) {
|
||||
return Vec2<T>(a).div(b);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline Vec2<T> operator-(const Vec2<T> &a) {
|
||||
return Vec2<T>(a).neg();
|
||||
|
@ -196,21 +216,41 @@ inline Vec3<T> operator+(const Vec3<T> &a, const Vec3<T> &b) {
|
|||
return Vec3<T>(a).add(b);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline Vec3<T> operator+(const Vec3<T> &a, T b) {
|
||||
return Vec3<T>(a).add(b);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline Vec3<T> operator-(const Vec3<T> &a, const Vec3<T> &b) {
|
||||
return Vec3<T>(a).sub(b);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline Vec3<T> operator-(const Vec3<T> &a, T b) {
|
||||
return Vec3<T>(a).sub(b);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline Vec3<T> operator*(const Vec3<T> &a, const Vec3<T> &b) {
|
||||
return Vec3<T>(a).mul(b);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline Vec3<T> operator*(const Vec3<T> &a, T b) {
|
||||
return Vec3<T>(a).mul(b);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline Vec3<T> operator/(const Vec3<T> &a, const Vec3<T> &b) {
|
||||
return Vec3<T>(a).div(b);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline Vec3<T> operator/(const Vec3<T> &a, T b) {
|
||||
return Vec3<T>(a).div(b);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline Vec3<T> operator-(const Vec3<T> &a) {
|
||||
return Vec3<T>(a).neg();
|
||||
|
@ -302,21 +342,41 @@ inline Vec4<T> operator+(const Vec4<T> &a, const Vec4<T> &b) {
|
|||
return Vec4<T>(a).add(b);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline Vec4<T> operator+(const Vec4<T> &a, T b) {
|
||||
return Vec4<T>(a).add(b);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline Vec4<T> operator-(const Vec4<T> &a, const Vec4<T> &b) {
|
||||
return Vec4<T>(a).sub(b);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline Vec4<T> operator-(const Vec4<T> &a, T b) {
|
||||
return Vec4<T>(a).sub(b);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline Vec4<T> operator*(const Vec4<T> &a, const Vec4<T> &b) {
|
||||
return Vec4<T>(a).mul(b);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline Vec4<T> operator*(const Vec4<T> &a, T b) {
|
||||
return Vec4<T>(a).mul(b);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline Vec4<T> operator/(const Vec4<T> &a, const Vec4<T> &b) {
|
||||
return Vec4<T>(a).div(b);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline Vec4<T> operator/(const Vec4<T> &a, T b) {
|
||||
return Vec4<T>(a).div(b);
|
||||
}
|
||||
|
||||
template<typename T>
|
||||
inline Vec4<T> operator-(const Vec4<T> &a) {
|
||||
return Vec4<T>(a).neg();
|
||||
|
|
Loading…
Reference in New Issue