/// @ref core /// @file glm/detail/type_vec1.inl namespace glm { // -- Implicit basic constructors -- # if !GLM_HAS_DEFAULTED_FUNCTIONS || !defined(GLM_FORCE_NO_CTOR_INIT) template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec1::tvec1() # ifndef GLM_FORCE_NO_CTOR_INIT : x(0) # endif {} # endif//!GLM_HAS_DEFAULTED_FUNCTIONS # if !GLM_HAS_DEFAULTED_FUNCTIONS template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec1::tvec1(tvec1 const & v) : x(v.x) {} # endif//!GLM_HAS_DEFAULTED_FUNCTIONS template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec1::tvec1(tvec1 const & v) : x(v.x) {} // -- Explicit basic constructors -- template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec1::tvec1(ctor) {} template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec1::tvec1(T scalar) : x(scalar) {} // -- Conversion vector constructors -- template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec1::tvec1(tvec1 const & v) : x(static_cast(v.x)) {} template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec1::tvec1(tvec2 const & v) : x(static_cast(v.x)) {} template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec1::tvec1(tvec3 const & v) : x(static_cast(v.x)) {} template template GLM_FUNC_QUALIFIER GLM_CONSTEXPR_CTOR tvec1::tvec1(tvec4 const & v) : x(static_cast(v.x)) {} // -- Component accesses -- template GLM_FUNC_QUALIFIER T & tvec1::operator[](typename tvec1::length_type i) { assert(i >= 0 && i < this->length()); return (&x)[i]; } template GLM_FUNC_QUALIFIER T const & tvec1::operator[](typename tvec1::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 tvec1 & tvec1::operator=(tvec1 const & v) { this->x = v.x; return *this; } # endif//!GLM_HAS_DEFAULTED_FUNCTIONS template template GLM_FUNC_QUALIFIER tvec1 & tvec1::operator=(tvec1 const & v) { this->x = static_cast(v.x); return *this; } template template GLM_FUNC_QUALIFIER tvec1 & tvec1::operator+=(U scalar) { this->x += static_cast(scalar); return *this; } template template GLM_FUNC_QUALIFIER tvec1 & tvec1::operator+=(tvec1 const & v) { this->x += static_cast(v.x); return *this; } template template GLM_FUNC_QUALIFIER tvec1 & tvec1::operator-=(U scalar) { this->x -= static_cast(scalar); return *this; } template template GLM_FUNC_QUALIFIER tvec1 & tvec1::operator-=(tvec1 const & v) { this->x -= static_cast(v.x); return *this; } template template GLM_FUNC_QUALIFIER tvec1 & tvec1::operator*=(U scalar) { this->x *= static_cast(scalar); return *this; } template template GLM_FUNC_QUALIFIER tvec1 & tvec1::operator*=(tvec1 const & v) { this->x *= static_cast(v.x); return *this; } template template GLM_FUNC_QUALIFIER tvec1 & tvec1::operator/=(U scalar) { this->x /= static_cast(scalar); return *this; } template template GLM_FUNC_QUALIFIER tvec1 & tvec1::operator/=(tvec1 const & v) { this->x /= static_cast(v.x); return *this; } // -- Increment and decrement operators -- template GLM_FUNC_QUALIFIER tvec1 & tvec1::operator++() { ++this->x; return *this; } template GLM_FUNC_QUALIFIER tvec1 & tvec1::operator--() { --this->x; return *this; } template GLM_FUNC_QUALIFIER tvec1 tvec1::operator++(int) { tvec1 Result(*this); ++*this; return Result; } template GLM_FUNC_QUALIFIER tvec1 tvec1::operator--(int) { tvec1 Result(*this); --*this; return Result; } // -- Unary bit operators -- template template GLM_FUNC_QUALIFIER tvec1 & tvec1::operator%=(U scalar) { this->x %= static_cast(scalar); return *this; } template template GLM_FUNC_QUALIFIER tvec1 & tvec1::operator%=(tvec1 const & v) { this->x %= static_cast(v.x); return *this; } template template GLM_FUNC_QUALIFIER tvec1 & tvec1::operator&=(U scalar) { this->x &= static_cast(scalar); return *this; } template template GLM_FUNC_QUALIFIER tvec1 & tvec1::operator&=(tvec1 const & v) { this->x &= static_cast(v.x); return *this; } template template GLM_FUNC_QUALIFIER tvec1 & tvec1::operator|=(U scalar) { this->x |= static_cast(scalar); return *this; } template template GLM_FUNC_QUALIFIER tvec1 & tvec1::operator|=(tvec1 const & v) { this->x |= U(v.x); return *this; } template template GLM_FUNC_QUALIFIER tvec1 & tvec1::operator^=(U scalar) { this->x ^= static_cast(scalar); return *this; } template template GLM_FUNC_QUALIFIER tvec1 & tvec1::operator^=(tvec1 const & v) { this->x ^= static_cast(v.x); return *this; } template template GLM_FUNC_QUALIFIER tvec1 & tvec1::operator<<=(U scalar) { this->x <<= static_cast(scalar); return *this; } template template GLM_FUNC_QUALIFIER tvec1 & tvec1::operator<<=(tvec1 const & v) { this->x <<= static_cast(v.x); return *this; } template template GLM_FUNC_QUALIFIER tvec1 & tvec1::operator>>=(U scalar) { this->x >>= static_cast(scalar); return *this; } template template GLM_FUNC_QUALIFIER tvec1 & tvec1::operator>>=(tvec1 const & v) { this->x >>= static_cast(v.x); return *this; } // -- Unary constant operators -- template GLM_FUNC_QUALIFIER tvec1 operator+(tvec1 const & v) { return v; } template GLM_FUNC_QUALIFIER tvec1 operator-(tvec1 const & v) { return tvec1( -v.x); } // -- Binary arithmetic operators -- template GLM_FUNC_QUALIFIER tvec1 operator+(tvec1 const & v, T scalar) { return tvec1( v.x + scalar); } template GLM_FUNC_QUALIFIER tvec1 operator+(T scalar, tvec1 const & v) { return tvec1( scalar + v.x); } template GLM_FUNC_QUALIFIER tvec1 operator+(tvec1 const & v1, tvec1 const & v2) { return tvec1( v1.x + v2.x); } //operator- template GLM_FUNC_QUALIFIER tvec1 operator-(tvec1 const & v, T scalar) { return tvec1( v.x - scalar); } template GLM_FUNC_QUALIFIER tvec1 operator-(T scalar, tvec1 const & v) { return tvec1( scalar - v.x); } template GLM_FUNC_QUALIFIER tvec1 operator-(tvec1 const & v1, tvec1 const & v2) { return tvec1( v1.x - v2.x); } template GLM_FUNC_QUALIFIER tvec1 operator*(tvec1 const & v, T scalar) { return tvec1( v.x * scalar); } template GLM_FUNC_QUALIFIER tvec1 operator*(T scalar, tvec1 const & v) { return tvec1( scalar * v.x); } template GLM_FUNC_QUALIFIER tvec1 operator*(tvec1 const & v1, tvec1 const & v2) { return tvec1( v1.x * v2.x); } template GLM_FUNC_QUALIFIER tvec1 operator/(tvec1 const & v, T scalar) { return tvec1( v.x / scalar); } template GLM_FUNC_QUALIFIER tvec1 operator/(T scalar, tvec1 const & v) { return tvec1( scalar / v.x); } template GLM_FUNC_QUALIFIER tvec1 operator/(tvec1 const & v1, tvec1 const & v2) { return tvec1( v1.x / v2.x); } // -- Binary bit operators -- template GLM_FUNC_QUALIFIER tvec1 operator%(tvec1 const & v, T scalar) { return tvec1( v.x % scalar); } template GLM_FUNC_QUALIFIER tvec1 operator%(T scalar, tvec1 const & v) { return tvec1( scalar % v.x); } template GLM_FUNC_QUALIFIER tvec1 operator%(tvec1 const & v1, tvec1 const & v2) { return tvec1( v1.x % v2.x); } template GLM_FUNC_QUALIFIER tvec1 operator&(tvec1 const & v, T scalar) { return tvec1( v.x & scalar); } template GLM_FUNC_QUALIFIER tvec1 operator&(T scalar, tvec1 const & v) { return tvec1( scalar & v.x); } template GLM_FUNC_QUALIFIER tvec1 operator&(tvec1 const & v1, tvec1 const & v2) { return tvec1( v1.x & v2.x); } template GLM_FUNC_QUALIFIER tvec1 operator|(tvec1 const & v, T scalar) { return tvec1( v.x | scalar); } template GLM_FUNC_QUALIFIER tvec1 operator|(T scalar, tvec1 const & v) { return tvec1( scalar | v.x); } template GLM_FUNC_QUALIFIER tvec1 operator|(tvec1 const & v1, tvec1 const & v2) { return tvec1( v1.x | v2.x); } template GLM_FUNC_QUALIFIER tvec1 operator^(tvec1 const & v, T scalar) { return tvec1( v.x ^ scalar); } template GLM_FUNC_QUALIFIER tvec1 operator^(T scalar, tvec1 const & v) { return tvec1( scalar ^ v.x); } template GLM_FUNC_QUALIFIER tvec1 operator^(tvec1 const & v1, tvec1 const & v2) { return tvec1( v1.x ^ v2.x); } template GLM_FUNC_QUALIFIER tvec1 operator<<(tvec1 const & v, T scalar) { return tvec1( v.x << scalar); } template GLM_FUNC_QUALIFIER tvec1 operator<<(T scalar, tvec1 const & v) { return tvec1( scalar << v.x); } template GLM_FUNC_QUALIFIER tvec1 operator<<(tvec1 const & v1, tvec1 const & v2) { return tvec1( v1.x << v2.x); } template GLM_FUNC_QUALIFIER tvec1 operator>>(tvec1 const & v, T scalar) { return tvec1( v.x >> scalar); } template GLM_FUNC_QUALIFIER tvec1 operator>>(T scalar, tvec1 const & v) { return tvec1( scalar >> v.x); } template GLM_FUNC_QUALIFIER tvec1 operator>>(tvec1 const & v1, tvec1 const & v2) { return tvec1( v1.x >> v2.x); } template GLM_FUNC_QUALIFIER tvec1 operator~(tvec1 const & v) { return tvec1( ~v.x); } // -- Boolean operators -- template GLM_FUNC_QUALIFIER bool operator==(tvec1 const & v1, tvec1 const & v2) { return (v1.x == v2.x); } template GLM_FUNC_QUALIFIER bool operator!=(tvec1 const & v1, tvec1 const & v2) { return (v1.x != v2.x); } template GLM_FUNC_QUALIFIER tvec1 operator&&(tvec1 const & v1, tvec1 const & v2) { return tvec1(v1.x && v2.x); } template GLM_FUNC_QUALIFIER tvec1 operator||(tvec1 const & v1, tvec1 const & v2) { return tvec1(v1.x || v2.x); } }//namespace glm