Chunks
Moddable voxel sandbox for room-scale VR.
|
Represents an integral position or offset in 3D space. More...
Public Member Functions | |
IntVector (int x, int y, int z) | |
Constructs a new vector with the given X, Y, and Z components. More... | |
int | Dot (IntVector other) |
Finds the scalar product of this vector and another. More... | |
IntVector | Cross (IntVector other) |
Finds the cross product of this vector and another. More... | |
bool | Equals (IntVector other) |
Tests for equality with another vector. More... | |
override bool | Equals (object obj) |
Tests for equality with another object. More... | |
override int | GetHashCode () |
Returns the hash code for this vector. More... | |
override string | ToString () |
Returns a string representation of this vector. More... | |
Static Public Member Functions | |
static implicit | operator IntVector (IntVector2D a) |
static | operator IntVector2D (IntVector a) |
static | operator IntVector (Vector vec) |
Casts each component of a Vector into integers. More... | |
static IntVector | operator- (IntVector a) |
Negates a vector. More... | |
static IntVector | operator+ (IntVector a, IntVector b) |
Adds two vectors together. More... | |
static IntVector | operator- (IntVector a, IntVector b) |
Subtracts a vector from another. More... | |
static IntVector | operator* (IntVector a, IntVector b) |
Multiplies two vectors together. More... | |
static IntVector | operator* (IntVector vec, int scalar) |
Multiplies a vector by a scalar. More... | |
static IntVector | operator* (int scalar, IntVector vec) |
Multiplies a vector by a scalar. More... | |
static Vector | operator* (IntVector vec, float scalar) |
Multiplies a vector by a scalar. More... | |
static Vector | operator* (float scalar, IntVector vec) |
Multiplies a vector by a scalar. More... | |
static IntVector | operator/ (IntVector vec, int denom) |
Divides a vector by a scalar. More... | |
static Vector | operator/ (IntVector vec, float denom) |
Divides a vector by a scalar. More... | |
static IntVector | operator<< (IntVector vec, int shift) |
Left shifts each component of the vector by the given amount. More... | |
static IntVector | operator>> (IntVector vec, int shift) |
Right shifts each component of the vector by the given amount. More... | |
static bool | operator== (IntVector a, IntVector b) |
Tests for equality between two vectors. More... | |
static bool | operator!= (IntVector a, IntVector b) |
Tests for inequality between two vectors. More... | |
static IntVector | Min (IntVector a, IntVector b) |
Finds the component-wise minimum of two vectors. More... | |
static IntVector | Max (IntVector a, IntVector b) |
Finds the component-wise maximum of two vectors. More... | |
Public Attributes | |
readonly int | X |
X component of the vector. More... | |
readonly int | Y |
Y component of the vector. More... | |
readonly int | Z |
Z component of the vector. More... | |
Static Public Attributes | |
static readonly IntVector | Zero = new IntVector(0, 0, 0) |
The zero vector with 0 for X, Y, and Z. More... | |
static readonly IntVector | One = new IntVector(1, 1, 1) |
A vector with 1 for X, Y, and Z. More... | |
static readonly IntVector | UnitX = new IntVector(1, 0, 0) |
A unit vector pointing along +X. More... | |
static readonly IntVector | UnitY = new IntVector(0, 1, 0) |
A unit vector pointing along +Y. More... | |
static readonly IntVector | UnitZ = new IntVector(0, 0, 1) |
A unit vector pointing along +Z. More... | |
Properties | |
int | LengthSquared [get] |
Finds the squared length of the vector. More... | |
int | this[int index] [get] |
Gets a component of the vector by indexl with 0 for X, 1 for Y, and 2 for Z. More... | |
Represents an integral position or offset in 3D space.
Chunks.Geometry.IntVector.IntVector | ( | int | x, |
int | y, | ||
int | z | ||
) |
Constructs a new vector with the given X, Y, and Z components.
x | X component |
y | Y component |
z | Z component |
Finds the cross product of this vector and another.
other | Vector to find the cross product with |
int Chunks.Geometry.IntVector.Dot | ( | IntVector | other | ) |
Finds the scalar product of this vector and another.
other | Vector to find the scalar product with |
bool Chunks.Geometry.IntVector.Equals | ( | IntVector | other | ) |
Tests for equality with another vector.
other | Vector to test for equality with |
override bool Chunks.Geometry.IntVector.Equals | ( | object | obj | ) |
Tests for equality with another object.
obj | Object to test for equality with |
override int Chunks.Geometry.IntVector.GetHashCode | ( | ) |
Returns the hash code for this vector.
Finds the component-wise maximum of two vectors.
a | First vector to find the maximum of |
b | Second vector to find the maximum of |
Finds the component-wise minimum of two vectors.
a | First vector to find the minimum of |
b | Second vector to find the minimum of |
|
static |
|
explicitstatic |
Tests for inequality between two vectors.
a | First vector to test for inequality with |
b | Second vector to test for inequality with |
Multiplies two vectors together.
a | First vector to multiply |
b | Second vector to multiply |
Multiplies a vector by a scalar.
vec | Vector to multiply |
scalar | Scalar value to multiply by |
Multiplies a vector by a scalar.
vec | Vector to multiply |
scalar | Scalar value to multiply by |
Multiplies a vector by a scalar.
vec | Vector to multiply |
scalar | Scalar value to multiply by |
Multiplies a vector by a scalar.
vec | Vector to multiply |
scalar | Scalar value to multiply by |
Adds two vectors together.
a | First vector to add |
b | Second vector to add |
Negates a vector.
a | Vector to negate |
Divides a vector by a scalar.
vec | Vector to divide |
denom | Scalar value to divide by |
Divides a vector by a scalar.
vec | Vector to divide |
denom | Scalar value to divide by |
Left shifts each component of the vector by the given amount.
vec | Vector to shift |
shift | Amount to shift by |
Tests for equality between two vectors.
a | First vector to test for equality with |
b | Second vector to test for equality with |
Right shifts each component of the vector by the given amount.
vec | Vector to shift |
shift | Amount to shift by |
override string Chunks.Geometry.IntVector.ToString | ( | ) |
Returns a string representation of this vector.
A vector with 1 for X, Y, and Z.
A unit vector pointing along +X.
A unit vector pointing along +Y.
A unit vector pointing along +Z.
readonly int Chunks.Geometry.IntVector.X |
X component of the vector.
readonly int Chunks.Geometry.IntVector.Y |
Y component of the vector.
readonly int Chunks.Geometry.IntVector.Z |
Z component of the vector.
The zero vector with 0 for X, Y, and Z.
|
get |
Finds the squared length of the vector.
|
get |
Gets a component of the vector by indexl with 0 for X, 1 for Y, and 2 for Z.
index | Index of the component to get |