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