struct Vector3Int

book_4_sparkGenerated
code_blocksInput

Description

The Vector3Int struct represents a 3D vector with integer components. It is a sealed, value type that provides various methods and properties for vector operations, such as calculating the dot product, cross product, and more. This struct is useful for operations that require integer precision in 3D space.

Members

Static Members

Member NameSummary
OneAn integer vector with all components set to 1.
ZeroAn integer vector with all components set to 0.
ForwardAn integer vector with X set to 1. This represents the forward direction.
BackwardAn integer vector with X set to -1. This represents the backward direction.
UpAn integer vector with Z set to 1. This represents the up direction.
DownAn integer vector with Z set to -1. This represents the down direction.
RightAn integer vector with Y set to 1. This represents the right direction.
LeftAn integer vector with Y set to -1. This represents the left direction.
OneXAn integer vector with X set to 1.
OneYAn integer vector with Y set to 1.
OneZAn integer vector with Z set to 1.
CrossCalculates the cross product of two vectors.
DotCalculates the dot product of two vectors.
GetAngleCalculates the angle between two vectors.
MinReturns a vector with the minimum components of two vectors.
MaxReturns a vector with the maximum components of two vectors.
ParseParses a string to create a Vector3Int.
TryParseTries to parse a string to create a Vector3Int.

Instance Members

Member NameSummary
IsNearlyZeroChecks if the vector is nearly zero within a given tolerance.
WriteWrites the vector to a binary writer.
ReadReads a vector from a binary reader.
ComponentMinReturns a vector with the minimum components compared to another vector.
ComponentMaxReturns a vector with the maximum components compared to another vector.
DistanceCalculates the distance to another vector.
SnapToGridSnaps the vector to a grid of a specified size.
AbsReturns a new integer vector with all values positive.
WithXReturns a new vector with the X component set to a specified value.
WithYReturns a new vector with the Y component set to a specified value.
WithZReturns a new vector with the Z component set to a specified value.
NormalReturns a unit version of this vector as a Vector3.
EulerAnglesThe Euler angles of this direction vector.
InverseReturns the inverse of this vector as a Vector3.
ItemGets or sets the component at the specified index.
LengthLength (or magnitude) of the integer vector.
LengthSquaredSquared length of the integer vector.
IsZeroLengthWhether the length of this vector is zero or not.
xThe X component of this integer vector.
yThe Y component of this integer vector.
zThe Z component of this integer vector.