Vector3Intclass

objectVector3Int
Namespace
global
Assembly
Sandbox.System
Declaration
public sealed struct Vector3Int

Constructors3

Showing 3 constructors

Methods23

Showing 23 methods

public Vector3Int Abs()PUBLIC

Returns a new integer vector with all values positive. -5 becomes 5, ect.

Returns:Vector3Int

public Vector3Int ComponentMax(Vector3Int other)PUBLIC

Returns an integer vector that has the maximum values on each axis between this vector and a given vector.

ParameterTypeDescription
otherVector3Int
Returns:Vector3Int

public Vector3Int ComponentMin(Vector3Int other)PUBLIC

Returns an integer vector that has the minimum values on each axis between this vector and a given vector.

ParameterTypeDescription
otherVector3Int
Returns:Vector3Int

public static Vector3Int Cross(Vector3Int a, Vector3Int b)PUBLICSTATIC

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.

ParameterTypeDescription
aVector3Int
bVector3Int
Returns:Vector3Int

public bool IsNearlyZero(int tolerance = 0)PUBLIC

Returns true if value on every axis is less than or equal to tolerance.

ParameterTypeDescription
tolerance = 0int
Returns:bool

public Vector3Int Read(System.IO.BinaryReader reader)PUBLIC

ParameterTypeDescription
readerBinaryReader
Returns:Vector3Int

public Vector3Int SnapToGrid(int gridSize, bool sx = True, bool sy = True, bool sz = True)PUBLIC

Snap to grid along any of the 3 axes.

ParameterTypeDescription
gridSizeint
sx = Truebool
sy = Truebool
sz = Truebool
Returns:Vector3Int

public static override bool TryParse(string str, System.IFormatProvider info, Vector3Int result)PUBLICSTATICOVERRIDE

ParameterTypeDescription
strstring
infoIFormatProvider
resultVector3Int
Returns:bool

public Vector3Int WithX(int x)PUBLIC

Returns this integer vector with given X component.

ParameterTypeDescription
xint
Returns:Vector3Int

public Vector3Int WithY(int y)PUBLIC

Returns this integer vector with given Y component.

ParameterTypeDescription
yint
Returns:Vector3Int

public Vector3Int WithZ(int z)PUBLIC

Returns this integer vector with given Z component.

ParameterTypeDescription
zint
Returns:Vector3Int

public void Write(System.IO.BinaryWriter writer)PUBLIC

ParameterTypeDescription
writerBinaryWriter
Returns:void

Properties7

Showing 7 properties

public Angles Vector3Int.EulerAngles { get; set; }PUBLICGETSET

The Euler angles of this direction vector.

Returns:Angles

public Vector3 Vector3Int.Inverse { get; set; }PUBLICGETSET

Returns the inverse of this vector, which is useful for scaling vectors. Keep in mind this returns a Vector3 and not a Vector3Int.

Returns:Vector3

public bool Vector3Int.IsZeroLength { get; set; }PUBLICGETSET

Whether the length of this vector is zero or not.

Returns:bool

public float Vector3Int.Length { get; set; }PUBLICGETSET

Length (or magnitude) of the integer vector (Distance from 0,0,0)

Returns:float

public int Vector3Int.LengthSquared { get; set; }PUBLICGETSET

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.

Returns:int

public Vector3 Vector3Int.Normal { get; set; }PUBLICGETSET

Returns a unit version of this vector. Keep in mind this returns a Vector3 and not a Vector3Int.

Returns:Vector3

On this page

Constructorspublic Vector3Int(System.Int32 x, System.Int32 y, System.Int32 z)public Vector3Int(System.Int32 all = 0)public Vector3Int(Vector3Int vector3Int)Methodspublic Vector3Int Abs()public Vector3Int ComponentMax(Vector3Int other)public Vector3Int ComponentMin(Vector3Int other)public static Vector3Int Cross(Vector3Int a, Vector3Int b)public System.Single Distance(Vector3 other)public System.Single Distance(Vector3Int other)public System.Single Dot(Vector3 b)public static System.Single Dot(Vector3Int a, Vector3 b)public static System.Single Dot(Vector3Int a, Vector3Int b)public System.Single Dot(Vector3Int b)public static System.Single GetAngle(Vector3Int v1, Vector3Int v2)public System.Boolean IsNearlyZero(System.Int32 tolerance = 0)public static Vector3Int Max(Vector3Int a, Vector3Int b)public static Vector3Int Min(Vector3Int a, Vector3Int b)public static override Vector3Int Parse(System.String str, System.IFormatProvider provider)public static Vector3Int Parse(System.String str)public Vector3Int Read(System.IO.BinaryReader reader)public Vector3Int SnapToGrid(System.Int32 gridSize, System.Boolean sx = True, System.Boolean sy = True, System.Boolean sz = True)public static override System.Boolean TryParse(System.String str, System.IFormatProvider info, Vector3Int result)public Vector3Int WithX(System.Int32 x)public Vector3Int WithY(System.Int32 y)public Vector3Int WithZ(System.Int32 z)public System.Void Write(System.IO.BinaryWriter writer)Propertiespublic Angles Vector3Int.EulerAngles { get; set; }public Vector3 Vector3Int.Inverse { get; set; }public System.Boolean Vector3Int.IsZeroLength { get; set; }public System.Int32 Vector3Int.Item { get; set; }public System.Single Vector3Int.Length { get; set; }public System.Int32 Vector3Int.LengthSquared { get; set; }public Vector3 Vector3Int.Normal { get; set; }Metadata