#pragma once #include #ifndef SEAD_MATH_VECTOR_H_ #include #endif namespace sead { template inline Vector2::Vector2(T x_, T y_) { Vector2CalcCommon::set(*this, x_, y_); } template inline Vector2& Vector2::operator+=(const Vector2& other) { Vector2CalcCommon::add(*this, *this, other); return *this; } template inline Vector2& Vector2::operator-=(const Vector2& other) { Vector2CalcCommon::sub(*this, *this, other); return *this; } template inline Vector2& Vector2::operator*=(T t) { this->x *= t; this->y *= t; return *this; } template inline Vector2& Vector2::operator/=(T t) { this->x /= t; this->y /= t; return *this; } template inline Vector2& Vector2::operator=(const Vector2& other) { Vector2CalcCommon::set(*this, other); return *this; } template inline void Vector2::set(const Vector2& other) { Vector2CalcCommon::set(*this, other); } template inline void Vector2::set(T x_, T y_) { Vector2CalcCommon::set(*this, x_, y_); } template inline Vector3::Vector3(T x_, T y_, T z_) { Vector3CalcCommon::set(*this, x_, y_, z_); } template inline Vector3& Vector3::operator=(const Vector3& other) { Vector3CalcCommon::set(*this, other); return *this; } template inline bool Vector3::operator==(const Vector3& rhs) const { return this->x == rhs.x && this->y == rhs.y && this->z == rhs.z; } template inline bool Vector3::operator!=(const Vector3& rhs) const { return !operator==(rhs); } template inline Vector3& Vector3::operator+=(const Vector3& other) { Vector3CalcCommon::add(*this, *this, other); return *this; } template inline Vector3& Vector3::operator-=(const Vector3& other) { Vector3CalcCommon::sub(*this, *this, other); return *this; } template inline Vector3& Vector3::operator*=(T t) { Vector3CalcCommon::multScalar(*this, *this, t); return *this; } template inline Vector3& Vector3::operator*=(const Mtx33& m) { mul(m); return *this; } template inline Vector3& Vector3::operator*=(const Mtx34& m) { mul(m); return *this; } template inline Vector3& Vector3::operator/=(T t) { this->x /= t; this->y /= t; this->z /= t; return *this; } template inline T Vector3::dot(const Vector3& t) const { return Vector3CalcCommon::dot(*this, t); } template inline T Vector3::length() const { return Vector3CalcCommon::length(*this); } template inline T Vector3::squaredLength() const { return Vector3CalcCommon::squaredLength(*this); } template inline bool Vector3::equals(const Vector3& rhs, T epsilon) const { return Vector3CalcCommon::equals(*this, rhs, epsilon); } template inline void Vector3::add(const Vector3& a) { Vector3CalcCommon::add(*this, *this, a); } template inline void Vector3::mul(const Mtx33& m) { setMul(m, *this); } template inline void Vector3::mul(const Mtx34& m) { setMul(m, *this); } template inline void Vector3::multScalar(T t) { Vector3CalcCommon::multScalar(*this, *this, t); } template inline T Vector3::normalize() { return Vector3CalcCommon::normalize(*this); } template inline void Vector3::set(const Vector3& other) { Vector3CalcCommon::set(*this, other); } template inline void Vector3::set(T x_, T y_, T z_) { Vector3CalcCommon::set(*this, x_, y_, z_); } template inline void Vector3::setCross(const Vector3& a, const Vector3& b) { Vector3CalcCommon::cross(*this, a, b); } template inline void Vector3::setScaleAdd(T t, const Vector3& a, const Vector3& b) { Vector3CalcCommon::multScalarAdd(*this, t, a, b); } template inline void Vector3::setMul(const Mtx33& m, const Vector3& a) { Vector3CalcCommon::mul(*this, m, a); } template inline void Vector3::setMul(const Mtx34& m, const Vector3& a) { Vector3CalcCommon::mul(*this, m, a); } template inline Vector4::Vector4(T x_, T y_, T z_, T w_) { Vector4CalcCommon::set(*this, x_, y_, z_, w_); } template inline Vector4& Vector4::operator+=(const Vector4& other) { this->x += other.x; this->y += other.y; this->z += other.z; this->w += other.w; return *this; } template inline Vector4& Vector4::operator-=(const Vector4& other) { this->x -= other.x; this->y -= other.y; this->z -= other.z; this->w -= other.w; return *this; } template inline Vector4& Vector4::operator*=(T t) { this->x *= t; this->y *= t; this->z *= t; this->w *= t; return *this; } template inline Vector4& Vector4::operator/=(T t) { this->x /= t; this->y /= t; this->z /= t; this->w /= t; return *this; } template inline Vector4& Vector4::operator=(const Vector4& other) { Vector4CalcCommon::set(*this, other); return *this; } template inline void Vector4::set(const Vector4& other) { Vector4CalcCommon::set(*this, other); } template inline void Vector4::set(T x_, T y_, T z_, T w_) { Vector4CalcCommon::set(*this, x_, y_, z_, w_); } } // namespace sead