/// @ref core /// @file glm/detail/type_tvec3.inl namespace glm { # ifdef GLM_STATIC_CONST_MEMBERS template const tvec3 tvec3::ZERO(static_cast(0), static_cast(0), static_cast(0)); template const tvec3 tvec3::X(static_cast(1), static_cast(0), static_cast(0)); template const tvec3 tvec3::Y(static_cast(0), static_cast(1), static_cast(0)); template const tvec3 tvec3::Z(static_cast(0), static_cast(0), static_cast(1)); template const tvec3 tvec3::XY(static_cast(1), static_cast(1), static_cast(0)); template const tvec3 tvec3::XZ(static_cast(1), static_cast(0), static_cast(1)); template const tvec3 tvec3::YZ(static_cast(0), static_cast(1), static_cast(1)); template const tvec3 tvec3::XYZ(static_cast(1), static_cast(1), static_cast(1)); # endif // -- Implicit basic constructors -- # if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec3::tvec3() # ifndef GLM_FORCE_NO_CTOR_INIT : x(0), y(0), z(0) # endif {} # endif//!GLM_HAS_DEFAULTED_FUNCTIONS # if !GLM_HAS_DEFAULTED_FUNCTIONS template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec3::tvec3(tvec3 const & v) : x(v.x), y(v.y), z(v.z) {} # endif//!GLM_HAS_DEFAULTED_FUNCTIONS template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec3::tvec3(tvec3 const & v) : x(v.x), y(v.y), z(v.z) {} // -- Explicit basic constructors -- template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec3::tvec3(ctor) {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec3::tvec3(T scalar) : x(scalar), y(scalar), z(scalar) {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec3::tvec3(T a, T b, T c) : x(a), y(b), z(c) {} // -- Conversion scalar constructors -- template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec3::tvec3(A a, B b, C c) : x(static_cast(a)), y(static_cast(b)), z(static_cast(c)) {} template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec3::tvec3(tvec1 const & a, tvec1 const & b, tvec1 const & c) : x(static_cast(a)), y(static_cast(b)), z(static_cast(c)) {} // -- Conversion vector constructors -- template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec3::tvec3(tvec2 const & a, B b) : x(static_cast(a.x)), y(static_cast(a.y)), z(static_cast(b)) {} template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec3::tvec3(tvec2 const & a, tvec1 const & b) : x(static_cast(a.x)), y(static_cast(a.y)), z(static_cast(b.x)) {} template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec3::tvec3(A a, tvec2 const & b) : x(static_cast(a)), y(static_cast(b.x)), z(static_cast(b.y)) {} template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec3::tvec3(tvec1 const & a, tvec2 const & b) : x(static_cast(a.x)), y(static_cast(b.x)), z(static_cast(b.y)) {} template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec3::tvec3(tvec3 const & v) : x(static_cast(v.x)), y(static_cast(v.y)), z(static_cast(v.z)) {} template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec3::tvec3(tvec4 const & v) : x(static_cast(v.x)), y(static_cast(v.y)), z(static_cast(v.z)) {} // -- Component accesses -- template GLM_FUNC_QUALIFIER T & tvec3::operator[](typename tvec3::length_type i) { assert(i >= 0 && i < this->length()); return (&x)[i]; } template GLM_FUNC_QUALIFIER T const & tvec3::operator[](typename tvec3::length_type i) const { assert(i >= 0 && i < this->length()); return (&x)[i]; } // -- Unary arithmetic operators -- # if !GLM_HAS_DEFAULTED_FUNCTIONS template GLM_FUNC_QUALIFIER tvec3& tvec3::operator=(tvec3 const & v) { this->x = v.x; this->y = v.y; this->z = v.z; return *this; } # endif//!GLM_HAS_DEFAULTED_FUNCTIONS template template GLM_FUNC_QUALIFIER tvec3& tvec3::operator=(tvec3 const & v) { this->x = static_cast(v.x); this->y = static_cast(v.y); this->z = static_cast(v.z); return *this; } template template GLM_FUNC_QUALIFIER tvec3 & tvec3::operator+=(U scalar) { this->x += static_cast(scalar); this->y += static_cast(scalar); this->z += static_cast(scalar); return *this; } template template GLM_FUNC_QUALIFIER tvec3 & tvec3::operator+=(tvec1 const & v) { this->x += static_cast(v.x); this->y += static_cast(v.x); this->z += static_cast(v.x); return *this; } template template GLM_FUNC_QUALIFIER tvec3 & tvec3::operator+=(tvec3 const & v) { this->x += static_cast(v.x); this->y += static_cast(v.y); this->z += static_cast(v.z); return *this; } template template GLM_FUNC_QUALIFIER tvec3 & tvec3::operator-=(U scalar) { this->x -= static_cast(scalar); this->y -= static_cast(scalar); this->z -= static_cast(scalar); return *this; } template template GLM_FUNC_QUALIFIER tvec3 & tvec3::operator-=(tvec1 const & v) { this->x -= static_cast(v.x); this->y -= static_cast(v.x); this->z -= static_cast(v.x); return *this; } template template GLM_FUNC_QUALIFIER tvec3 & tvec3::operator-=(tvec3 const & v) { this->x -= static_cast(v.x); this->y -= static_cast(v.y); this->z -= static_cast(v.z); return *this; } template template GLM_FUNC_QUALIFIER tvec3 & tvec3::operator*=(U scalar) { this->x *= static_cast(scalar); this->y *= static_cast(scalar); this->z *= static_cast(scalar); return *this; } template template GLM_FUNC_QUALIFIER tvec3 & tvec3::operator*=(tvec1 const & v) { this->x *= static_cast(v.x); this->y *= static_cast(v.x); this->z *= static_cast(v.x); return *this; } template template GLM_FUNC_QUALIFIER tvec3 & tvec3::operator*=(tvec3 const & v) { this->x *= static_cast(v.x); this->y *= static_cast(v.y); this->z *= static_cast(v.z); return *this; } template template GLM_FUNC_QUALIFIER tvec3 & tvec3::operator/=(U v) { this->x /= static_cast(v); this->y /= static_cast(v); this->z /= static_cast(v); return *this; } template template GLM_FUNC_QUALIFIER tvec3 & tvec3::operator/=(tvec1 const & v) { this->x /= static_cast(v.x); this->y /= static_cast(v.x); this->z /= static_cast(v.x); return *this; } template template GLM_FUNC_QUALIFIER tvec3 & tvec3::operator/=(tvec3 const & v) { this->x /= static_cast(v.x); this->y /= static_cast(v.y); this->z /= static_cast(v.z); return *this; } // -- Increment and decrement operators -- template GLM_FUNC_QUALIFIER tvec3 & tvec3::operator++() { ++this->x; ++this->y; ++this->z; return *this; } template GLM_FUNC_QUALIFIER tvec3 & tvec3::operator--() { --this->x; --this->y; --this->z; return *this; } template GLM_FUNC_QUALIFIER tvec3 tvec3::operator++(int) { tvec3 Result(*this); ++*this; return Result; } template GLM_FUNC_QUALIFIER tvec3 tvec3::operator--(int) { tvec3 Result(*this); --*this; return Result; } // -- Unary bit operators -- template template GLM_FUNC_QUALIFIER tvec3 & tvec3::operator%=(U scalar) { this->x %= scalar; this->y %= scalar; this->z %= scalar; return *this; } template template GLM_FUNC_QUALIFIER tvec3 & tvec3::operator%=(tvec1 const & v) { this->x %= v.x; this->y %= v.x; this->z %= v.x; return *this; } template template GLM_FUNC_QUALIFIER tvec3 & tvec3::operator%=(tvec3 const & v) { this->x %= v.x; this->y %= v.y; this->z %= v.z; return *this; } template template GLM_FUNC_QUALIFIER tvec3 & tvec3::operator&=(U scalar) { this->x &= scalar; this->y &= scalar; this->z &= scalar; return *this; } template template GLM_FUNC_QUALIFIER tvec3 & tvec3::operator&=(tvec1 const & v) { this->x &= v.x; this->y &= v.x; this->z &= v.x; return *this; } template template GLM_FUNC_QUALIFIER tvec3 & tvec3::operator&=(tvec3 const & v) { this->x &= v.x; this->y &= v.y; this->z &= v.z; return *this; } template template GLM_FUNC_QUALIFIER tvec3 & tvec3::operator|=(U scalar) { this->x |= scalar; this->y |= scalar; this->z |= scalar; return *this; } template template GLM_FUNC_QUALIFIER tvec3 & tvec3::operator|=(tvec1 const & v) { this->x |= v.x; this->y |= v.x; this->z |= v.x; return *this; } template template GLM_FUNC_QUALIFIER tvec3 & tvec3::operator|=(tvec3 const & v) { this->x |= v.x; this->y |= v.y; this->z |= v.z; return *this; } template template GLM_FUNC_QUALIFIER tvec3 & tvec3::operator^=(U scalar) { this->x ^= scalar; this->y ^= scalar; this->z ^= scalar; return *this; } template template GLM_FUNC_QUALIFIER tvec3 & tvec3::operator^=(tvec1 const & v) { this->x ^= v.x; this->y ^= v.x; this->z ^= v.x; return *this; } template template GLM_FUNC_QUALIFIER tvec3 & tvec3::operator^=(tvec3 const & v) { this->x ^= v.x; this->y ^= v.y; this->z ^= v.z; return *this; } template template GLM_FUNC_QUALIFIER tvec3 & tvec3::operator<<=(U scalar) { this->x <<= scalar; this->y <<= scalar; this->z <<= scalar; return *this; } template template GLM_FUNC_QUALIFIER tvec3 & tvec3::operator<<=(tvec1 const & v) { this->x <<= static_cast(v.x); this->y <<= static_cast(v.x); this->z <<= static_cast(v.x); return *this; } template template GLM_FUNC_QUALIFIER tvec3 & tvec3::operator<<=(tvec3 const & v) { this->x <<= static_cast(v.x); this->y <<= static_cast(v.y); this->z <<= static_cast(v.z); return *this; } template template GLM_FUNC_QUALIFIER tvec3 & tvec3::operator>>=(U scalar) { this->x >>= static_cast(scalar); this->y >>= static_cast(scalar); this->z >>= static_cast(scalar); return *this; } template template GLM_FUNC_QUALIFIER tvec3 & tvec3::operator>>=(tvec1 const & v) { this->x >>= static_cast(v.x); this->y >>= static_cast(v.x); this->z >>= static_cast(v.x); return *this; } template template GLM_FUNC_QUALIFIER tvec3 & tvec3::operator>>=(tvec3 const & v) { this->x >>= static_cast(v.x); this->y >>= static_cast(v.y); this->z >>= static_cast(v.z); return *this; } // -- Unary arithmetic operators -- template GLM_FUNC_QUALIFIER tvec3 operator+(tvec3 const & v) { return v; } template GLM_FUNC_QUALIFIER tvec3 operator-(tvec3 const & v) { return tvec3( -v.x, -v.y, -v.z); } // -- Binary arithmetic operators -- template GLM_FUNC_QUALIFIER tvec3 operator+(tvec3 const & v, T scalar) { return tvec3( v.x + scalar, v.y + scalar, v.z + scalar); } template GLM_FUNC_QUALIFIER tvec3 operator+(tvec3 const & v, tvec1 const & scalar) { return tvec3( v.x + scalar.x, v.y + scalar.x, v.z + scalar.x); } template GLM_FUNC_QUALIFIER tvec3 operator+(T scalar, tvec3 const & v) { return tvec3( scalar + v.x, scalar + v.y, scalar + v.z); } template GLM_FUNC_QUALIFIER tvec3 operator+(tvec1 const & scalar, tvec3 const & v) { return tvec3( scalar.x + v.x, scalar.x + v.y, scalar.x + v.z); } template GLM_FUNC_QUALIFIER tvec3 operator+(tvec3 const & v1, tvec3 const & v2) { return tvec3( v1.x + v2.x, v1.y + v2.y, v1.z + v2.z); } template GLM_FUNC_QUALIFIER tvec3 operator-(tvec3 const & v, T scalar) { return tvec3( v.x - scalar, v.y - scalar, v.z - scalar); } template GLM_FUNC_QUALIFIER tvec3 operator-(tvec3 const & v, tvec1 const & scalar) { return tvec3( v.x - scalar.x, v.y - scalar.x, v.z - scalar.x); } template GLM_FUNC_QUALIFIER tvec3 operator-(T scalar, tvec3 const & v) { return tvec3( scalar - v.x, scalar - v.y, scalar - v.z); } template GLM_FUNC_QUALIFIER tvec3 operator-(tvec1 const & scalar, tvec3 const & v) { return tvec3( scalar.x - v.x, scalar.x - v.y, scalar.x - v.z); } template GLM_FUNC_QUALIFIER tvec3 operator-(tvec3 const & v1, tvec3 const & v2) { return tvec3( v1.x - v2.x, v1.y - v2.y, v1.z - v2.z); } template GLM_FUNC_QUALIFIER tvec3 operator*(tvec3 const & v, T scalar) { return tvec3( v.x * scalar, v.y * scalar, v.z * scalar); } template GLM_FUNC_QUALIFIER tvec3 operator*(tvec3 const & v, tvec1 const & scalar) { return tvec3( v.x * scalar.x, v.y * scalar.x, v.z * scalar.x); } template GLM_FUNC_QUALIFIER tvec3 operator*(T scalar, tvec3 const & v) { return tvec3( scalar * v.x, scalar * v.y, scalar * v.z); } template GLM_FUNC_QUALIFIER tvec3 operator*(tvec1 const & scalar, tvec3 const & v) { return tvec3( scalar.x * v.x, scalar.x * v.y, scalar.x * v.z); } template GLM_FUNC_QUALIFIER tvec3 operator*(tvec3 const & v1, tvec3 const & v2) { return tvec3( v1.x * v2.x, v1.y * v2.y, v1.z * v2.z); } template GLM_FUNC_QUALIFIER tvec3 operator/(tvec3 const & v, T scalar) { return tvec3( v.x / scalar, v.y / scalar, v.z / scalar); } template GLM_FUNC_QUALIFIER tvec3 operator/(tvec3 const & v, tvec1 const & scalar) { return tvec3( v.x / scalar.x, v.y / scalar.x, v.z / scalar.x); } template GLM_FUNC_QUALIFIER tvec3 operator/(T scalar, tvec3 const & v) { return tvec3( scalar / v.x, scalar / v.y, scalar / v.z); } template GLM_FUNC_QUALIFIER tvec3 operator/(tvec1 const & scalar, tvec3 const & v) { return tvec3( scalar.x / v.x, scalar.x / v.y, scalar.x / v.z); } template GLM_FUNC_QUALIFIER tvec3 operator/(tvec3 const & v1, tvec3 const & v2) { return tvec3( v1.x / v2.x, v1.y / v2.y, v1.z / v2.z); } // -- Binary bit operators -- template GLM_FUNC_QUALIFIER tvec3 operator%(tvec3 const & v, T scalar) { return tvec3( v.x % scalar, v.y % scalar, v.z % scalar); } template GLM_FUNC_QUALIFIER tvec3 operator%(tvec3 const & v, tvec1 const & scalar) { return tvec3( v.x % scalar.x, v.y % scalar.x, v.z % scalar.x); } template GLM_FUNC_QUALIFIER tvec3 operator%(T scalar, tvec3 const & v) { return tvec3( scalar % v.x, scalar % v.y, scalar % v.z); } template GLM_FUNC_QUALIFIER tvec3 operator%(tvec1 const & scalar, tvec3 const & v) { return tvec3( scalar.x % v.x, scalar.x % v.y, scalar.x % v.z); } template GLM_FUNC_QUALIFIER tvec3 operator%(tvec3 const & v1, tvec3 const & v2) { return tvec3( v1.x % v2.x, v1.y % v2.y, v1.z % v2.z); } template GLM_FUNC_QUALIFIER tvec3 operator&(tvec3 const & v, T scalar) { return tvec3( v.x & scalar, v.y & scalar, v.z & scalar); } template GLM_FUNC_QUALIFIER tvec3 operator&(tvec3 const & v, tvec1 const & scalar) { return tvec3( v.x & scalar.x, v.y & scalar.x, v.z & scalar.x); } template GLM_FUNC_QUALIFIER tvec3 operator&(T scalar, tvec3 const & v) { return tvec3( scalar & v.x, scalar & v.y, scalar & v.z); } template GLM_FUNC_QUALIFIER tvec3 operator&(tvec1 const & scalar, tvec3 const & v) { return tvec3( scalar.x & v.x, scalar.x & v.y, scalar.x & v.z); } template GLM_FUNC_QUALIFIER tvec3 operator&(tvec3 const & v1, tvec3 const & v2) { return tvec3( v1.x & v2.x, v1.y & v2.y, v1.z & v2.z); } template GLM_FUNC_QUALIFIER tvec3 operator|(tvec3 const & v, T scalar) { return tvec3( v.x | scalar, v.y | scalar, v.z | scalar); } template GLM_FUNC_QUALIFIER tvec3 operator|(tvec3 const & v, tvec1 const & scalar) { return tvec3( v.x | scalar.x, v.y | scalar.x, v.z | scalar.x); } template GLM_FUNC_QUALIFIER tvec3 operator|(T scalar, tvec3 const & v) { return tvec3( scalar | v.x, scalar | v.y, scalar | v.z); } template GLM_FUNC_QUALIFIER tvec3 operator|(tvec1 const & scalar, tvec3 const & v) { return tvec3( scalar.x | v.x, scalar.x | v.y, scalar.x | v.z); } template GLM_FUNC_QUALIFIER tvec3 operator|(tvec3 const & v1, tvec3 const & v2) { return tvec3( v1.x | v2.x, v1.y | v2.y, v1.z | v2.z); } template GLM_FUNC_QUALIFIER tvec3 operator^(tvec3 const & v, T scalar) { return tvec3( v.x ^ scalar, v.y ^ scalar, v.z ^ scalar); } template GLM_FUNC_QUALIFIER tvec3 operator^(tvec3 const & v, tvec1 const & scalar) { return tvec3( v.x ^ scalar.x, v.y ^ scalar.x, v.z ^ scalar.x); } template GLM_FUNC_QUALIFIER tvec3 operator^(T scalar, tvec3 const & v) { return tvec3( scalar ^ v.x, scalar ^ v.y, scalar ^ v.z); } template GLM_FUNC_QUALIFIER tvec3 operator^(tvec1 const & scalar, tvec3 const & v) { return tvec3( scalar.x ^ v.x, scalar.x ^ v.y, scalar.x ^ v.z); } template GLM_FUNC_QUALIFIER tvec3 operator^(tvec3 const & v1, tvec3 const & v2) { return tvec3( v1.x ^ v2.x, v1.y ^ v2.y, v1.z ^ v2.z); } template GLM_FUNC_QUALIFIER tvec3 operator<<(tvec3 const & v, T scalar) { return tvec3( v.x << scalar, v.y << scalar, v.z << scalar); } template GLM_FUNC_QUALIFIER tvec3 operator<<(tvec3 const & v, tvec1 const & scalar) { return tvec3( v.x << scalar.x, v.y << scalar.x, v.z << scalar.x); } template GLM_FUNC_QUALIFIER tvec3 operator<<(T scalar, tvec3 const & v) { return tvec3( scalar << v.x, scalar << v.y, scalar << v.z); } template GLM_FUNC_QUALIFIER tvec3 operator<<(tvec1 const & scalar, tvec3 const & v) { return tvec3( scalar.x << v.x, scalar.x << v.y, scalar.x << v.z); } template GLM_FUNC_QUALIFIER tvec3 operator<<(tvec3 const & v1, tvec3 const & v2) { return tvec3( v1.x << v2.x, v1.y << v2.y, v1.z << v2.z); } template GLM_FUNC_QUALIFIER tvec3 operator>>(tvec3 const & v, T scalar) { return tvec3( v.x >> scalar, v.y >> scalar, v.z >> scalar); } template GLM_FUNC_QUALIFIER tvec3 operator>>(tvec3 const & v, tvec1 const & scalar) { return tvec3( v.x >> scalar.x, v.y >> scalar.x, v.z >> scalar.x); } template GLM_FUNC_QUALIFIER tvec3 operator>>(T scalar, tvec3 const & v) { return tvec3( scalar >> v.x, scalar >> v.y, scalar >> v.z); } template GLM_FUNC_QUALIFIER tvec3 operator>>(tvec1 const & scalar, tvec3 const & v) { return tvec3( scalar.x >> v.x, scalar.x >> v.y, scalar.x >> v.z); } template GLM_FUNC_QUALIFIER tvec3 operator>>(tvec3 const & v1, tvec3 const & v2) { return tvec3( v1.x >> v2.x, v1.y >> v2.y, v1.z >> v2.z); } template GLM_FUNC_QUALIFIER tvec3 operator~(tvec3 const & v) { return tvec3( ~v.x, ~v.y, ~v.z); } // -- Boolean operators -- template GLM_FUNC_QUALIFIER bool operator==(tvec3 const & v1, tvec3 const & v2) { return (v1.x == v2.x) && (v1.y == v2.y) && (v1.z == v2.z); } template GLM_FUNC_QUALIFIER bool operator!=(tvec3 const & v1, tvec3 const & v2) { return (v1.x != v2.x) || (v1.y != v2.y) || (v1.z != v2.z); } template GLM_FUNC_QUALIFIER tvec3 operator&&(tvec3 const & v1, tvec3 const & v2) { return tvec3(v1.x && v2.x, v1.y && v2.y, v1.z && v2.z); } template GLM_FUNC_QUALIFIER tvec3 operator||(tvec3 const & v1, tvec3 const & v2) { return tvec3(v1.x || v2.x, v1.y || v2.y, v1.z || v2.z); } }//namespace glm