Up to date

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

# Vector3i¶

## 属性¶

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

## 构造函数¶

 Vector3i Vector3i ( ) Vector3i Vector3i ( Vector3i from ) Vector3i Vector3i ( Vector3 from ) Vector3i Vector3i ( int x, int y, int z )

## 方法¶

 Vector3i abs ( ) const Vector3i clamp ( Vector3i min, Vector3i max ) const float length ( ) const int length_squared ( ) const int max_axis_index ( ) const int min_axis_index ( ) const Vector3i sign ( ) const Vector3i snapped ( Vector3i step ) const

## 操作符¶

 bool operator != ( Vector3i right ) Vector3i operator % ( Vector3i right ) Vector3i operator % ( int right ) Vector3i operator * ( Vector3i right ) Vector3 operator * ( float right ) Vector3i operator * ( int right ) Vector3i operator + ( Vector3i right ) Vector3i operator - ( Vector3i right ) Vector3i operator / ( Vector3i right ) Vector3 operator / ( float right ) Vector3i operator / ( int right ) bool operator < ( Vector3i right ) bool operator <= ( Vector3i right ) bool operator == ( Vector3i right ) bool operator > ( Vector3i right ) bool operator >= ( Vector3i right ) int operator [] ( int index ) Vector3i Vector3i

## 常量¶

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 返回。

ZERO = `Vector3i(0, 0, 0)`

ONE = `Vector3i(1, 1, 1)`

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

MAX = `Vector3i(2147483647, 2147483647, 2147483647)`

LEFT = `Vector3i(-1, 0, 0)`

RIGHT = `Vector3i(1, 0, 0)`

UP = `Vector3i(0, 1, 0)`

DOWN = `Vector3i(0, -1, 0)`

FORWARD = `Vector3i(0, 0, -1)`

BACK = `Vector3i(0, 0, 1)`

## 属性说明¶

int x = `0`

int y = `0`

int z = `0`

## 构造函数说明¶

Vector3i Vector3i ( )

Vector3i Vector3i ( Vector3i from )

Vector3i Vector3i ( Vector3 from )

Vector3i Vector3i ( int x, int y, int z )

## 方法说明¶

Vector3i abs ( ) const

Vector3i clamp ( Vector3i min, Vector3i max ) const

float length ( ) const

int length_squared ( ) const

int max_axis_index ( ) const

int min_axis_index ( ) const

Vector3i sign ( ) const

Vector3i snapped ( Vector3i step ) const

## 操作符说明¶

bool operator != ( Vector3i right )

Vector3i operator % ( Vector3i right )

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

Vector3i operator % ( int right )

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

Vector3i operator * ( Vector3i right )

```print(Vector3i(10, 20, 30) * Vector3i(3, 4, 5)) # 输出 "(30, 80, 150)"
```

Vector3 operator * ( float right )

```print(Vector3i(10, 15, 20) * 0.9) # 输出 "(9, 13.5, 18)"
```

Vector3i operator * ( int right )

Vector3i operator + ( Vector3i right )

```print(Vector3i(10, 20, 30) + Vector3i(3, 4, 5)) # 输出 "(13, 24, 35)"
```

Vector3i operator - ( Vector3i right )

```print(Vector3i(10, 20, 30) - Vector3i(3, 4, 5)) # 输出 "(7, 16, 25)"
```

Vector3i operator / ( Vector3i right )

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

Vector3 operator / ( float right )

```print(Vector3i(10, 20, 30) / 2.9) # 输出 "(5, 10, 15)"
```

Vector3i operator / ( int right )

bool operator < ( Vector3i right )

bool operator <= ( Vector3i right )

bool operator == ( Vector3i right )

bool operator > ( Vector3i right )

bool operator >= ( Vector3i right )

int operator [] ( int index )

Vector3i operator unary+ ( )

Vector3i operator unary- ( )