Vector3Int
public sealed struct Vector3Int Constructors
Vector3Int(Int32 x, Int32 y, Int32 z) Initializes an integer vector with given components.
x — The X component. y — The Y component. z — The Z component. Vector3Int(Int32 all) Initializes an integer vector with all components set to the same value.
all — The value of the X, Y, and Z components. Vector3Int(Vector3Int vector3Int) Initializes an integer vector with given components from another integer vector
vector3Int Properties
| Name | Type | Description |
|---|---|---|
Normal | Vector3 | Returns a unit version of this vector. Keep in mind this returns a Vector3 and not a Vector3Int. |
EulerAngles | Angles | The Euler angles of this direction vector. |
Inverse | Vector3 | Returns the inverse of this vector, which is useful for scaling vectors. Keep in mind this returns a Vector3 and not a Vector3Int. |
Item | Int32 | |
Length | Single | Length (or magnitude) of the integer vector (Distance from 0,0,0) |
LengthSquared | Int32 | Squared length of the integer vector. This is faster than Length, and can be used for things like comparing distances, as long as only squared values are used. |
IsZeroLength | Boolean | Whether the length of this vector is zero or not. |
Methods
Boolean IsNearlyZero(Int32 tolerance = 0) Returns true if value on every axis is less than or equal to tolerance.
Void Write(BinaryWriter writer) Vector3Int Read(BinaryReader reader) Vector3Int ComponentMin(Vector3Int other) Returns an integer vector that has the minimum values on each axis between this vector and a given vector.
Vector3Int ComponentMax(Vector3Int other) Returns an integer vector that has the maximum values on each axis between this vector and a given vector.
static Vector3Int Cross(Vector3Int a, Vector3Int b) Returns the cross product of this and the given integer vector. If this and the given vectors are linearly independent, the resulting vector is perpendicular to them both, also known as a normal of a plane.
static Single Dot(Vector3Int a, Vector3Int b) Returns the scalar/dot product of the 2 given integer vectors.
static Single Dot(Vector3Int a, Vector3 b) Returns the scalar/dot product of the 2 given vectors.
Single Dot(Vector3Int b) Returns the scalar/dot product of this and the given vector.
Single Dot(Vector3 b) Returns the scalar/dot product of this and the given vector.
Single Distance(Vector3Int other) Returns distance between this vector and another.
Single Distance(Vector3 other) Returns distance between this vector and another.
Vector3Int SnapToGrid(Int32 gridSize, Boolean sx = True, Boolean sy = True, Boolean sz = True) Snap to grid along any of the 3 axes.
static Single GetAngle(Vector3Int v1, Vector3Int v2) static Vector3Int Min(Vector3Int a, Vector3Int b) Returns an integer vector that has the minimum values on each axis between 2 given vectors.
static Vector3Int Max(Vector3Int a, Vector3Int b) Returns an integer vector that has the maximum values on each axis between 2 given vectors.
Vector3Int Abs() Returns a new integer vector with all values positive. -5 becomes 5, ect.
Vector3Int WithX(Int32 x) Returns this integer vector with given X component.
Vector3Int WithY(Int32 y) Returns this integer vector with given Y component.
Vector3Int WithZ(Int32 z) Returns this integer vector with given Z component.
static Vector3Int Parse(String str) Given a string, try to convert this into a Vector3Int. Example formatting is "x,y,z", "[x,y,z]", "x y z", etc.
static override Vector3Int Parse(String str, IFormatProvider provider) static override Boolean TryParse(String str, IFormatProvider info, Vector3Int result) Fields
| Name | Type | Description |
|---|---|---|
x | Int32 | The X component of this integer vector. |
y | Int32 | The Y component of this integer vector. |
z | Int32 | The Z component of this integer vector. |
One static | Vector3Int | An integer vector with all components set to 1. |
Zero static | Vector3Int | An integer vector with all components set to 0. |
Forward static | Vector3Int | An integer vector with X set to 1. This represents the forward direction. |
Backward static | Vector3Int | An integer vector with X set to -1. This represents the backward direction. |
Up static | Vector3Int | An integer vector with Z set to 1. This represents the up direction. |
Down static | Vector3Int | An integer vector with Z set to -1. This represents the down direction. |
Right static | Vector3Int | An integer vector with Y set to 1. This represents the right direction. |
Left static | Vector3Int | An integer vector with Y set to -1. This represents the left direction. |
OneX static | Vector3Int | An integer vector with X set to 1. |
OneY static | Vector3Int | An integer vector with Y set to 1. |
OneZ static | Vector3Int | An integer vector with Z set to 1. |
Sandbox.System Full Name: Vector3Int