Chunks
Moddable voxel sandbox for room-scale VR.
Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Properties | List of all members
Chunks.Geometry.IntVector2D Struct Reference

Represents an integral position or offset in 3D space. More...

Inheritance diagram for Chunks.Geometry.IntVector2D:

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

Detailed Description

Represents an integral position or offset in 3D space.

Constructor & Destructor Documentation

Chunks.Geometry.IntVector2D.IntVector2D ( int  x,
int  y 
)

Constructs a new vector with the given X and Y components.

Parameters
xX component
yY component

Member Function Documentation

int Chunks.Geometry.IntVector2D.Cross ( IntVector2D  other)

Finds the cross product of this vector and another.

Parameters
otherVector to find the cross product with
int Chunks.Geometry.IntVector2D.Dot ( IntVector2D  other)

Finds the scalar product of this vector and another.

Parameters
otherVector to find the scalar product with
bool Chunks.Geometry.IntVector2D.Equals ( IntVector2D  other)

Tests for equality with another vector.

Parameters
otherVector to test for equality with
override bool Chunks.Geometry.IntVector2D.Equals ( object  obj)

Tests for equality with another object.

Parameters
objObject to test for equality with
override int Chunks.Geometry.IntVector2D.GetHashCode ( )

Returns the hash code for this vector.

static IntVector2D Chunks.Geometry.IntVector2D.Max ( IntVector2D  a,
IntVector2D  b 
)
static

Finds the component-wise maximum of two vectors.

Parameters
aFirst vector to find the maximum of
bSecond vector to find the maximum of
static IntVector2D Chunks.Geometry.IntVector2D.Min ( IntVector2D  a,
IntVector2D  b 
)
static

Finds the component-wise minimum of two vectors.

Parameters
aFirst vector to find the minimum of
bSecond vector to find the minimum of
static Chunks.Geometry.IntVector2D.operator IntVector2D ( Vector2D  vec)
explicitstatic

Casts each component of a Vector into integers.

Parameters
vecVector to cast
static bool Chunks.Geometry.IntVector2D.operator!= ( IntVector2D  a,
IntVector2D  b 
)
static

Tests for inequality between two vectors.

Parameters
aFirst vector to test for inequality with
bSecond vector to test for inequality with
static IntVector2D Chunks.Geometry.IntVector2D.operator* ( IntVector2D  a,
IntVector2D  b 
)
static

Multiplies two vectors together.

Parameters
aFirst vector to multiply
bSecond vector to multiply
static IntVector2D Chunks.Geometry.IntVector2D.operator* ( IntVector2D  vec,
int  scalar 
)
static

Multiplies a vector by a scalar.

Parameters
vecVector to multiply
scalarScalar value to multiply by
static IntVector2D Chunks.Geometry.IntVector2D.operator* ( int  scalar,
IntVector2D  vec 
)
static

Multiplies a vector by a scalar.

Parameters
vecVector to multiply
scalarScalar value to multiply by
static Vector2D Chunks.Geometry.IntVector2D.operator* ( IntVector2D  vec,
float  scalar 
)
static

Multiplies a vector by a scalar.

Parameters
vecVector to multiply
scalarScalar value to multiply by
static Vector2D Chunks.Geometry.IntVector2D.operator* ( float  scalar,
IntVector2D  vec 
)
static

Multiplies a vector by a scalar.

Parameters
vecVector to multiply
scalarScalar value to multiply by
static IntVector2D Chunks.Geometry.IntVector2D.operator+ ( IntVector2D  a,
IntVector2D  b 
)
static

Adds two vectors together.

Parameters
aFirst vector to add
bSecond vector to add
static IntVector2D Chunks.Geometry.IntVector2D.operator- ( IntVector2D  a)
static

Negates a vector.

Parameters
aVector to negate
static IntVector2D Chunks.Geometry.IntVector2D.operator- ( IntVector2D  a,
IntVector2D  b 
)
static

Subtracts a vector from another.

Parameters
aVector to be subtracted from
bVector to subtract
static IntVector2D Chunks.Geometry.IntVector2D.operator/ ( IntVector2D  vec,
int  denom 
)
static

Divides a vector by a scalar.

Parameters
vecVector to divide
denomScalar value to divide by
static Vector2D Chunks.Geometry.IntVector2D.operator/ ( IntVector2D  vec,
float  denom 
)
static

Divides a vector by a scalar.

Parameters
vecVector to divide
denomScalar value to divide by
static IntVector2D Chunks.Geometry.IntVector2D.operator<< ( IntVector2D  vec,
int  shift 
)
static

Left shifts each component of the vector by the given amount.

Parameters
vecVector to shift
shiftAmount to shift by
static bool Chunks.Geometry.IntVector2D.operator== ( IntVector2D  a,
IntVector2D  b 
)
static

Tests for equality between two vectors.

Parameters
aFirst vector to test for equality with
bSecond vector to test for equality with
static IntVector2D Chunks.Geometry.IntVector2D.operator>> ( IntVector2D  vec,
int  shift 
)
static

Right shifts each component of the vector by the given amount.

Parameters
vecVector to shift
shiftAmount to shift by
override string Chunks.Geometry.IntVector2D.ToString ( )

Returns a string representation of this vector.

Member Data Documentation

readonly IntVector2D Chunks.Geometry.IntVector2D.One = new IntVector2D(1, 1)
static

A vector with 1 for X and Y.

readonly IntVector2D Chunks.Geometry.IntVector2D.UnitX = new IntVector2D(1, 0)
static

A unit vector pointing along +X.

readonly IntVector2D Chunks.Geometry.IntVector2D.UnitY = new IntVector2D(0, 1)
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.

readonly IntVector2D Chunks.Geometry.IntVector2D.Zero = new IntVector2D(0, 0)
static

The zero vector with 0 for X and Y.

Property Documentation

int Chunks.Geometry.IntVector2D.LengthSquared
get

Finds the squared length of the vector.

int Chunks.Geometry.IntVector2D.this[int index]
get

Gets a component of the vector by indexl with 0 for X, and 1 for Y.

Parameters
indexIndex of the component to get

The documentation for this struct was generated from the following file: