# Vector3i

### Description

Vector with three dimensions and integer type.\
\
**Vector3i** used for dealing with translation, sizes, angles of objects where where don't require the\
float point precision. In all other cases [Vector3f ](/force/force-scripting-api/force/vector3f.md)or [Vector2f ](/force/force-scripting-api/force/vector2f.md)will be used.\ <br>

### Static Properties

<table><thead><tr><th width="324"></th><th></th></tr></thead><tbody><tr><td><mark style="color:red;">Left</mark></td><td>Represents a Left direction of vector. [-1, 0, 0].</td></tr><tr><td><mark style="color:red;">Right</mark></td><td>Represents a Right direction of vector. [1, 0, 0].</td></tr><tr><td><mark style="color:red;">Up</mark></td><td>Represents a Up direction of vector. [0, 1, 0].</td></tr><tr><td><mark style="color:red;">Down</mark></td><td>Represents a Down direction of vector. [0, -1, 0].</td></tr><tr><td><mark style="color:red;">Forward</mark></td><td>Represents a Forward direction of vector. [0, 0, 1].</td></tr><tr><td><mark style="color:red;">Backward</mark></td><td>Represents a Backward direction of vector. [0, 0, -1].</td></tr><tr><td><mark style="color:red;">One</mark></td><td>Constructs the Vector3i with [1, 1, 1] values.</td></tr><tr><td><mark style="color:red;">Zero</mark></td><td>Constructs the Vector3i with [0, 0, 0] values</td></tr></tbody></table>

### Properties

<table><thead><tr><th width="322"></th><th></th></tr></thead><tbody><tr><td><mark style="color:red;">x</mark></td><td>The X component of this vector.</td></tr><tr><td><mark style="color:red;">y</mark></td><td>The Y component of this vector.</td></tr><tr><td><mark style="color:red;">z</mark></td><td>The Z component of this vector.</td></tr><tr><td><mark style="color:red;">this[int index]</mark></td><td>Access to X or Y or Z component of this vector as [0], [1], [2].</td></tr><tr><td><mark style="color:red;">Count</mark></td><td>Returns the length (count of components) of the Vector3i.</td></tr></tbody></table>

### Constructors

<table><thead><tr><th width="321"></th><th></th></tr></thead><tbody><tr><td><mark style="color:red;">Vector3i</mark></td><td>Construct new <mark style="color:red;">Vector3i</mark> with default values [0, 0, 0].</td></tr><tr><td><mark style="color:red;">Vector3i(float x, float y, float z)</mark></td><td>Construct new <mark style="color:red;">Vector3i</mark> from x, y, z values.</td></tr><tr><td><mark style="color:red;">Vector3i(float scalar)</mark></td><td>Construct new <mark style="color:red;">Vector3i</mark> and set all its values to scalar.</td></tr><tr><td><mark style="color:red;">Vector3i(Vector3i v)</mark></td><td>Construct new <mark style="color:red;">Vector3i</mark> from another <mark style="color:red;">Vector3i</mark>. </td></tr><tr><td><mark style="color:red;">Vector3i(Vector2i v)</mark></td><td>Construct new <mark style="color:red;">Vector3i</mark> from another <mark style="color:red;">Vector2i</mark>, z values stay untouched.</td></tr></tbody></table>

### Methods

<table><thead><tr><th width="322"></th><th></th></tr></thead><tbody><tr><td><mark style="color:red;">Set</mark></td><td>Set vector values. (3 overloads)</td></tr><tr><td><mark style="color:red;">Equals</mark></td><td>Check if this vector equals v.</td></tr><tr><td><mark style="color:red;">Clamp</mark></td><td>Clamps the <mark style="color:red;">Vector3i</mark> to min and max bounds.</td></tr><tr><td><mark style="color:red;">ToString</mark></td><td>Convert <mark style="color:red;">Vector3i</mark> to String.</td></tr><tr><td><mark style="color:red;">AsString</mark></td><td>String representation of <mark style="color:red;">Vector3i</mark>. This another version in format of x: 0, y: 0, z: 0.</td></tr></tbody></table>

### Static Methods

<table><thead><tr><th width="322"></th><th></th></tr></thead><tbody><tr><td><mark style="color:red;">Distance</mark></td><td>Computes the distance between two vectors.</td></tr><tr><td><mark style="color:red;">Min</mark></td><td>Returns the vector witch made from the largest components of two vectors.</td></tr><tr><td><mark style="color:red;">Max</mark></td><td>Returns the vector witch made from the smallest components of two vectors.</td></tr><tr><td><mark style="color:red;">Ceil</mark></td><td>Ceil each component of given Vector3f and returns result in Vector3i.</td></tr><tr><td><mark style="color:red;">Floor</mark></td><td>Floor each component of given Vector3f and returns result in Vector3i.</td></tr><tr><td><mark style="color:red;">Round</mark></td><td>Round each component of given Vector3f and returns result in Vector3i.</td></tr><tr><td><mark style="color:red;">Scale</mark></td><td>Scales two vectors component-wise. This is the same as operator* a * b.</td></tr></tbody></table>

### Operators

<table><thead><tr><th width="150"></th><th></th></tr></thead><tbody><tr><td><mark style="color:red;">operator +(Vector3i v, Vector3i o)</mark></td><td>Adds this <mark style="color:red;">Vector3i</mark> to another.</td></tr><tr><td><mark style="color:red;">operator +(Vector3i v, float scalar)</mark></td><td>Adds each component of <mark style="color:red;">Vector3i</mark> by scalar.</td></tr><tr><td><mark style="color:red;">operator +(Vector3i v, Vector2i o)</mark></td><td><mark style="color:red;">Vector2i</mark> to this <mark style="color:red;">Vector3i</mark>.</td></tr><tr><td><mark style="color:red;">operator -(Vector3i v, Vector3i o)</mark></td><td>Subtract this <mark style="color:red;">Vector3i</mark> from another.</td></tr><tr><td><mark style="color:red;">operator -(Vector3i v, float scalar)</mark></td><td>Subtract scalar from each <mark style="color:red;">Vector3i</mark> component.</td></tr><tr><td><mark style="color:red;">Vector4 operator -(Vector3i v, Vector2i o)</mark></td><td>Subtract <mark style="color:red;">Vector2i</mark> from this <mark style="color:red;">Vector3i</mark>.</td></tr><tr><td><mark style="color:red;">operator *(Vector3i v, Vector3i o)</mark></td><td>Multiply <mark style="color:red;">Vector3i</mark> with another <mark style="color:red;">Vector3i</mark> .</td></tr><tr><td><mark style="color:red;">operator *(Vector3i m, float scalar)</mark></td><td>Multiply scalar by each <mark style="color:red;">Vector3i</mark> component.</td></tr><tr><td><mark style="color:red;">operator *(Vector3i v, Vector3i o)</mark></td><td>Multiply <mark style="color:red;">Vector3f</mark> by this <mark style="color:red;">Vector3i</mark> .</td></tr><tr><td><mark style="color:red;">operator /(Vector3i v, Vector3i o)</mark></td><td>Divide this <mark style="color:red;">Vector3i</mark> another <mark style="color:red;">Vector3i</mark>.</td></tr><tr><td><mark style="color:red;">operator /(Vector3i v, float scalar)</mark></td><td>Divide scalar value from this vector.</td></tr><tr><td><mark style="color:red;">operator /(Vector3i v, Vector2i o)</mark></td><td>Divide this <mark style="color:red;">Vector3i</mark> by <mark style="color:red;">Vector2i</mark>.</td></tr><tr><td><mark style="color:red;">explicit operator Vector2i(Vector3i v)</mark></td><td>Converts a <mark style="color:red;">Vector3i</mark> to <mark style="color:red;">Vector2i</mark>.</td></tr><tr><td><mark style="color:red;">explicit operator Vector3f(Vector3i v)</mark></td><td>Converts a <mark style="color:red;">Vector3i</mark> to <mark style="color:red;">Vector3f</mark>.</td></tr></tbody></table>

### See Also

[Matrix4](/force/force-scripting-api/force/matrix4f.md), [Vector4](/force/force-scripting-api/force/vector4f.md), [Vector3](/force/force-scripting-api/force/vector3f.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://danil-dukhovenko.gitbook.io/force/force-scripting-api/force/vector3i.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
