Up to date

This page is up to date for Godot `4.2`. If you still find outdated information, please open an issue.

# Vector4i¶

## 属性¶

 int w `0` int x `0` int y `0` int z `0`

## 构造函数¶

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

## 方法¶

 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

## 操作符¶

 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 ) Vector4i Vector4i

## 常量¶

AXIS_X = `0`

X 轴的枚举值。由 max_axis_indexmin_axis_index 返回。

AXIS_Y = `1`

Y 轴的枚举值。由 max_axis_indexmin_axis_index 返回。

AXIS_Z = `2`

Z 轴的枚举值。由 max_axis_indexmin_axis_index 返回。

AXIS_W = `3`

W 轴的枚举值。由 max_axis_indexmin_axis_index 返回。

ZERO = `Vector4i(0, 0, 0, 0)`

ONE = `Vector4i(1, 1, 1, 1)`

MIN = `Vector4i(-2147483648, -2147483648, -2147483648, -2147483648)`

MAX = `Vector4i(2147483647, 2147483647, 2147483647, 2147483647)`

## 属性说明¶

int w = `0`

int x = `0`

int y = `0`

int z = `0`

## 构造函数说明¶

Vector4i Vector4i ( )

Vector4i Vector4i ( Vector4i from )

Vector4i Vector4i ( Vector4 from )

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

## 方法说明¶

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

## 操作符说明¶

bool operator != ( Vector4i right )

Vector4i operator % ( Vector4i right )

```print(Vector4i(10, -20, 30, -40) % Vector4i(7, 8, 9, 10))  # 输出 "(3, -4, 3, 0)"
```

Vector4i operator % ( int right )

```print(Vector4i(10, -20, 30, -40) % 7)  # 输出 "(3, -6, 2, -5)"
```

Vector4i operator * ( Vector4i right )

```print(Vector4i(10, 20, 30, 40) * Vector4i(3, 4, 5, 6))# 输出 "(30, 80, 150, 240)"
```

Vector4 operator * ( float right )

```print(Vector4i(10, 20, 30, 40) * 2) # 输出 "(20, 40, 60, 80)"
```

Vector4i operator * ( int right )

Vector4i operator + ( Vector4i right )

```print(Vector4i(10, 20, 30, 40) + Vector4i(3, 4, 5, 6)) # 输出 "(13, 24, 35, 46)"
```

Vector4i operator - ( Vector4i right )

```print(Vector4i(10, 20, 30, 40) - Vector4i(3, 4, 5, 6)) # 输出 "(7, 16, 25, 34)"
```

Vector4i operator / ( Vector4i right )

```print(Vector4i(10, 20, 30, 40) / Vector4i(2, 5, 3, 4)) # 输出 "(5, 4, 10, 10)"
```

Vector4 operator / ( float right )

```print(Vector4i(10, 20, 30, 40) / 2 # 输出 "(5, 10, 15, 20)"
```

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 )

Vector4i operator unary+ ( )

Vector4i operator unary- ( )