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.IntVector Struct Reference

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

Inheritance diagram for Chunks.Geometry.IntVector:

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

Detailed Description

Represents an integral position or offset in 3D space.

Constructor & Destructor Documentation

Chunks.Geometry.IntVector.IntVector ( int  x,
int  y,
int  z 
)

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

Parameters
xX component
yY component
zZ component

Member Function Documentation

IntVector Chunks.Geometry.IntVector.Cross ( IntVector  other)

Finds the cross product of this vector and another.

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

Finds the scalar product of this vector and another.

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

Tests for equality with another vector.

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

Tests for equality with another object.

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

Returns the hash code for this vector.

static IntVector Chunks.Geometry.IntVector.Max ( IntVector  a,
IntVector  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 IntVector Chunks.Geometry.IntVector.Min ( IntVector  a,
IntVector  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 implicit Chunks.Geometry.IntVector.operator IntVector ( IntVector2D  a)
static
static Chunks.Geometry.IntVector.operator IntVector ( Vector  vec)
explicitstatic

Casts each component of a Vector into integers.

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

Tests for inequality between two vectors.

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

Multiplies two vectors together.

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

Multiplies a vector by a scalar.

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

Multiplies a vector by a scalar.

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

Multiplies a vector by a scalar.

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

Multiplies a vector by a scalar.

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

Adds two vectors together.

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

Negates a vector.

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

Subtracts a vector from another.

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

Divides a vector by a scalar.

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

Divides a vector by a scalar.

Parameters
vecVector to divide
denomScalar value to divide by
static IntVector Chunks.Geometry.IntVector.operator<< ( IntVector  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.IntVector.operator== ( IntVector  a,
IntVector  b 
)
static

Tests for equality between two vectors.

Parameters
aFirst vector to test for equality with
bSecond vector to test for equality with
static IntVector Chunks.Geometry.IntVector.operator>> ( IntVector  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.IntVector.ToString ( )

Returns a string representation of this vector.

Member Data Documentation

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

A vector with 1 for X, Y, and Z.

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

A unit vector pointing along +X.

readonly IntVector Chunks.Geometry.IntVector.UnitY = new IntVector(0, 1, 0)
static

A unit vector pointing along +Y.

readonly IntVector Chunks.Geometry.IntVector.UnitZ = new IntVector(0, 0, 1)
static

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.

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

The zero vector with 0 for X, Y, and Z.

Property Documentation

int Chunks.Geometry.IntVector.LengthSquared
get

Finds the squared length of the vector.

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

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

Parameters
indexIndex of the component to get

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