Vector4i

A 4D vector using integer coordinates.

Description

A 4-element structure that can be used to represent 4D grid coordinates or any other quadruplet of integers.

It uses integer coordinates and is therefore preferable to Vector4 when exact precision is required. Note that the values are limited to 32 bits, and unlike Vector4 this cannot be configured with an engine build option. Use int or PackedInt64Array if 64-bit values are needed.

Note: In a boolean context, a Vector4i will evaluate to false if it's equal to Vector4i(0, 0, 0, 0). Otherwise, a Vector3i will always evaluate to true.

Properties

int

w

0

int

x

0

int

y

0

int

z

0

Constructors

Vector4i

Vector4i ( )

Vector4i

Vector4i ( Vector4i from )

Vector4i

Vector4i ( Vector4 from )

Vector4i

Vector4i ( int x, int y, int z, int w )

Methods

Vector4i

abs ( ) const

Vector4i

clamp ( Vector4i min, Vector4i max ) const

float

length ( ) const

int

length_squared ( ) const

int

max_axis_index ( ) const

int

min_axis_index ( ) const

Vector4i

sign ( ) const

Vector4i

snapped ( Vector4i step ) const

Operators

bool

operator != ( Vector4i right )

Vector4i

operator % ( Vector4i right )

Vector4i

operator % ( int right )

Vector4i

operator * ( Vector4i right )

Vector4

operator * ( float right )

Vector4i

operator * ( int right )

Vector4i

operator + ( Vector4i right )

Vector4i

operator - ( Vector4i right )

Vector4i

operator / ( Vector4i right )

Vector4

operator / ( float right )

Vector4i

operator / ( int right )

bool

operator < ( Vector4i right )

bool

operator <= ( Vector4i right )

bool

operator == ( Vector4i right )

bool

operator > ( Vector4i right )

bool

operator >= ( Vector4i right )

int

operator [] ( int index )