Math v0.0.1
uint4

Unsigned integer 4 component vector structure. More...

#include <uint.hpp>

Public Member Functions

constexpr uint4 (uint32 xyzw=0u) noexcept
 Creates a new unsigned integer 4 component vector structure.
 
constexpr uint4 (uint32 x, uint32 y, uint32 z, uint32 w) noexcept
 Creates a new unsigned integer 4 component vector structure.
 
constexpr uint4 (uint2 xy, uint32 z, uint32 w) noexcept
 Creates a new unsigned integer 4 component vector structure.
 
constexpr uint4 (uint32 x, uint2 yz, uint32 w) noexcept
 Creates a new unsigned integer 4 component vector structure.
 
constexpr uint4 (uint32 x, uint32 y, uint2 zw) noexcept
 Creates a new unsigned integer 4 component vector structure.
 
constexpr uint4 (uint2 xy, uint2 zw) noexcept
 Creates a new unsigned integer 4 component vector structure.
 
constexpr uint4 (uint3 xyz, uint32 w) noexcept
 Creates a new unsigned integer 4 component vector structure.
 
constexpr uint4 (uint32 x, uint3 yzw) noexcept
 Creates a new unsigned integer 4 component vector structure.
 
uint32operator[] (psize i) noexcept
 Returns vector component by index.
 
uint32 operator[] (psize i) const noexcept
 Returns vector component by index.
 
constexpr operator uint3 () const noexcept
 Returns as 3 component unsigned integer vector. (xyz)
 
constexpr operator uint2 () const noexcept
 Returns as 2 component unsigned integer vector. (xy)
 
constexpr operator uint32 () const noexcept
 Returns first vector component value. (x)
 
constexpr uint4 operator+ (uint4 v) const noexcept
 
constexpr uint4 operator- (uint4 v) const noexcept
 
constexpr uint4 operator* (uint4 v) const noexcept
 
constexpr uint4 operator/ (uint4 v) const noexcept
 
constexpr uint4 operator% (uint4 v) const noexcept
 
constexpr uint4 operator& (uint4 v) const noexcept
 
constexpr uint4 operator| (uint4 v) const noexcept
 
constexpr uint4 operator^ (uint4 v) const noexcept
 
constexpr uint4 operator>> (uint4 v) const noexcept
 
constexpr uint4 operator<< (uint4 v) const noexcept
 
constexpr uint4 operator+ (uint32 n) const noexcept
 
constexpr uint4 operator- (uint32 n) const noexcept
 
constexpr uint4 operator* (uint32 n) const noexcept
 
constexpr uint4 operator/ (uint32 n) const noexcept
 
constexpr uint4 operator% (uint32 n) const noexcept
 
constexpr uint4 operator& (uint32 n) const noexcept
 
constexpr uint4 operator| (uint32 n) const noexcept
 
constexpr uint4 operator^ (uint32 n) const noexcept
 
constexpr uint4 operator>> (uint32 n) const noexcept
 
constexpr uint4 operator<< (uint32 n) const noexcept
 
constexpr uint4 operator- () const noexcept
 
constexpr uint4 operator! () const noexcept
 
constexpr uint4 operator~ () const noexcept
 
uint4operator+= (uint4 v) noexcept
 
uint4operator-= (uint4 v) noexcept
 
uint4operator*= (uint4 v) noexcept
 
uint4operator/= (uint4 v) noexcept
 
uint4operator%= (uint4 v) noexcept
 
uint4operator&= (uint4 v) noexcept
 
uint4operator|= (uint4 v) noexcept
 
uint4operator^= (uint4 v) noexcept
 
uint4operator>>= (uint4 v) noexcept
 
uint4operator<<= (uint4 v) noexcept
 
uint4operator+= (uint32 n) noexcept
 
uint4operator-= (uint32 n) noexcept
 
uint4operator*= (uint32 n) noexcept
 
uint4operator/= (uint32 n) noexcept
 
uint4operator%= (uint32 n) noexcept
 
uint4operator&= (uint32 n) noexcept
 
uint4operator|= (uint32 n) noexcept
 
uint4operator^= (uint32 n) noexcept
 
uint4operator>>= (uint32 n) noexcept
 
uint4operator<<= (uint32 n) noexcept
 
uint4operator= (uint32 n) noexcept
 
constexpr bool operator== (uint4 v) const noexcept
 
constexpr bool operator!= (uint4 v) const noexcept
 
constexpr uint4 operator< (uint4 v) const noexcept
 
constexpr uint4 operator> (uint4 v) const noexcept
 
constexpr uint4 operator<= (uint4 v) const noexcept
 
constexpr uint4 operator>= (uint4 v) const noexcept
 
constexpr bool operator== (uint32 n) const noexcept
 
constexpr bool operator!= (uint32 n) const noexcept
 
constexpr uint4 operator< (uint32 n) const noexcept
 
constexpr uint4 operator> (uint32 n) const noexcept
 
constexpr uint4 operator<= (uint32 n) const noexcept
 
constexpr uint4 operator>= (uint32 n) const noexcept
 

Public Attributes

uint32 x
 
uint32 y
 
uint32 z
 
uint32 w
 

Static Public Attributes

static const uint4 zero = uint4(0u)
 
static const uint4 one = uint4(1u)
 

Detailed Description

Unsigned integer 4 component vector structure.

Commonly used to represent: points, positions, etc.

Constructor & Destructor Documentation

◆ uint4() [1/8]

constexpr uint4 ( uint32 xyzw = 0u)
inlineexplicitconstexprnoexcept

Creates a new unsigned integer 4 component vector structure.

Parameters
xyzwtarget value for all vector components

◆ uint4() [2/8]

constexpr uint4 ( uint32 x,
uint32 y,
uint32 z,
uint32 w )
inlineconstexprnoexcept

Creates a new unsigned integer 4 component vector structure.

Parameters
xfirst vector component value
ysecond vector component value
zthird vector component value
wfourth vector component value

◆ uint4() [3/8]

constexpr uint4 ( uint2 xy,
uint32 z,
uint32 w )
inlineconstexprnoexcept

Creates a new unsigned integer 4 component vector structure.

Parameters
xyfirst and second vector components value
zthird vector component value
wfourth vector component value

◆ uint4() [4/8]

constexpr uint4 ( uint32 x,
uint2 yz,
uint32 w )
inlineconstexprnoexcept

Creates a new unsigned integer 4 component vector structure.

Parameters
xfirst vector component value
yzsecond and third vector components value
wfourth vector component value

◆ uint4() [5/8]

constexpr uint4 ( uint32 x,
uint32 y,
uint2 zw )
inlineconstexprnoexcept

Creates a new unsigned integer 4 component vector structure.

Parameters
xfirst vector component value
ysecond vector component value
zwthird and fourth vector components value

◆ uint4() [6/8]

constexpr uint4 ( uint2 xy,
uint2 zw )
inlineconstexprnoexcept

Creates a new unsigned integer 4 component vector structure.

Parameters
xyfirst and second vector components value
zwthird and fourth vector components value

◆ uint4() [7/8]

constexpr uint4 ( uint3 xyz,
uint32 w )
inlineconstexprnoexcept

Creates a new unsigned integer 4 component vector structure.

Parameters
xyzfirst, second and third vector components value
wfourth vector component value

◆ uint4() [8/8]

constexpr uint4 ( uint32 x,
uint3 yzw )
inlineconstexprnoexcept

Creates a new unsigned integer 4 component vector structure.

Parameters
xfirst vector component value
yzwsecond, third and fourth vector components value

Member Function Documentation

◆ operator[]() [1/2]

uint32 & operator[] ( psize i)
inlinenoexcept

Returns vector component by index.

Parameters
itarget component index

◆ operator[]() [2/2]

uint32 operator[] ( psize i) const
inlinenoexcept

Returns vector component by index.

Parameters
itarget component index

Member Data Documentation

◆ x

uint32 x

First vector component.

◆ y

uint32 y

Second vector component.

◆ z

uint32 z

Third vector component.

◆ w

uint32 w

Fourth vector component.