Warning! This version of documentation is OUTDATED, as it describes an older SDK version! Please switch to the documentation for the latest SDK version.
Warning! This version of documentation describes an old SDK version which is no longer supported! Please upgrade to the latest SDK version.

# Unigine::ivec2 Struct

Vector of 2 integer components.

To use this structure, include the UnigineMathLib.h file.

## ivec2()

Default constructor that produces a zero vector.

## ivec2(const ivec2 & v)

Initialization by a vector.

### Arguments

• const ivec2 & v - The value of the vector.

## ivec2(int x, int y)

Initialization by scalars.

### Arguments

• int x - X component of the vector.
• int y - Y component of the vector.

## explicit ivec2(int v)

Initialization by a scalar: x=v, y=v.

### Arguments

• int v - The value of the vector.

## explicit ivec2(const vec2 & v)

Initialization by a vector.

### Arguments

• const vec2 & v - The value of the vector.

## explicit ivec2(const dvec2 & v)

Initialization by a vector of double components.

### Arguments

• const dvec2 & v - The value of the vector.

## explicit ivec2(const int * v)

Initialization by a pointer to the vector.

### Arguments

• const int * v - Pointer to the vector.

## voidset(int x_, int y_)

Set vector.

### Arguments

• int x_ - X component of the vector.
• int y_ - Y component of the vector.

## voidset(const int * val)

Set vector.

### Arguments

• const int * val - Pointer to the vector.

## voidset(const ivec2 & val)

### Arguments

• const ivec2 & val

• int val

## int *get()

Get a pointer to the vector.

### Return value

Pointer to the vector.

## const int *get() const

Get a constant pointer to the vector.

### Return value

Pointer to the vector.

• int * val

## ivec2 &operator*=(int val)

Scalar multiplication.

### Arguments

• int val - The value of the scalar.

### Return value

The resulting vector.

## ivec2 &operator*=(const ivec2 & val)

Vector multiplication.

### Arguments

• const ivec2 & val - The value of the vector.

### Return value

The resulting vector.

## ivec2 &operator+=(const ivec2 & val)

### Arguments

• const ivec2 & val - The value of the vector.

### Return value

The resulting vector.

## ivec2operator-() const

Vector negation.

### Return value

The resulting vector.

## ivec2 &operator-=(const ivec2 & val)

Vector subtraction.

### Arguments

• const ivec2 & val - The value of the vector.

### Return value

The resulting vector.

## ivec2 &operator/=(int val)

Scalar division.

### Arguments

• int val - The value of the scalar.

### Return value

The resulting vector.

## ivec2 &operator/=(const ivec2 & val)

Vector division.

### Arguments

• const ivec2 & val - The value of the vector.

### Return value

The resulting vector.

## ivec2 &operator<<=(int val)

Left bit shift.

### Arguments

• int val - The shift amount.

### Return value

The resulting vector.

## ivec2 &operator=(const ivec2 & val)

### Arguments

• const ivec2 & val

## ivec2 &operator>>=(int val)

Right bit shift.

### Arguments

• int val - The shift amount.

### Return value

The resulting vector.

## int &operator[](int i)

Array access.

### Arguments

• int i - Array item index.

The array item.

## intoperator[](int i) const

Constant array access.

### Arguments

• int i - Array item index.

The array item.

## int ZERO

Last update: 2017-07-03