s&box docs

public sealed struct Vector3Int

Broader workflow and conceptual references connected to this API.

Constructors

Showing 3 constructors

Methods

Showing 23 methods

public Vector3Int Abs()

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

public Vector3Int ComponentMax(Vector3Int other)

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

public Vector3Int ComponentMin(Vector3Int other)

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

public 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.

public bool IsNearlyZero(int tolerance = 0)

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

Parameters

  • tolerance: Default: 0

public Vector3Int Read(System.IO.BinaryReader reader)

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

Snap to grid along any of the 3 axes.

Parameters

  • sx: Default: True
  • sy: Default: True
  • sz: Default: True

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

public Vector3Int WithX(int x)

Returns this integer vector with given X component.

public Vector3Int WithY(int y)

Returns this integer vector with given Y component.

public Vector3Int WithZ(int z)

Returns this integer vector with given Z component.

public void Write(System.IO.BinaryWriter writer)

Properties

Showing 7 properties

public Angles Vector3Int.EulerAngles { get; set; }

The Euler angles of this direction vector.

public Vector3 Vector3Int.Inverse { get; set; }

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

public bool Vector3Int.IsZeroLength { get; set; }

Whether the length of this vector is zero or not.

public float Vector3Int.Length { get; set; }

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

public int Vector3Int.LengthSquared { get; set; }

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.

public Vector3 Vector3Int.Normal { get; set; }

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

Metadata

FieldValue
Namespaceglobal
Typeclass
AssemblySandbox.System
Doc IDT:Vector3Int

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