Arcade
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
GameAPI.Vector2I Struct Reference

A two component vector of integers. More...

Public Member Functions

 Vector2I (int x, int y)
 Constructs a vector from the given X and Y components. More...
 
int Dot (Vector2I vec)
 Finds the scalar product of this vector and another. More...
 
override bool Equals (object obj)
 
bool Equals (Vector2I vec)
 Tests for equality with another vector. More...
 
override int GetHashCode ()
 
override string ToString ()
 Gets a string representing this vector in (X, Y) format. More...
 

Static Public Member Functions

static implicit operator Vector2F (Vector2I vec)
 
static Vector2I operator+ (Vector2I vec)
 The identity operator. More...
 
static Vector2I operator+ (Vector2I a, Vector2I b)
 Component-wise addition of a vector to another. More...
 
static Vector2I operator- (Vector2I vec)
 Finds the negation of a vector. More...
 
static Vector2I operator- (Vector2I a, Vector2I b)
 Component-wise subtraction of a vector from another. More...
 
static Vector2I operator* (Vector2I a, Vector2I b)
 Component-wise multiplication of a vector by another. More...
 
static Vector2I operator* (Vector2I vec, int val)
 Multiplies a vector by a scalar. More...
 
static Vector2F operator* (Vector2I vec, float val)
 Multiplies a vector by a scalar. More...
 
static Vector2I operator* (int val, Vector2I vec)
 Multiplies a vector by a scalar. More...
 
static Vector2F operator* (float val, Vector2I vec)
 Multiplies a vector by a scalar. More...
 
static Vector2I operator/ (Vector2I a, Vector2I b)
 Component-wise division of this vector by another. More...
 
static Vector2I operator/ (Vector2I vec, int val)
 Division of this vector by a scalar. More...
 
static Vector2F operator/ (Vector2I vec, float val)
 
static Vector2I operator/ (int val, Vector2I vec)
 
static Vector2F operator/ (float val, Vector2I vec)
 

Public Attributes

int X
 Horizontal component. More...
 
int Y
 Vertical component. More...
 

Static Public Attributes

static readonly Vector2I Zero = new Vector2I(0, 0)
 A vector with zero for all components. More...
 
static readonly Vector2I UnitX = new Vector2I(1, 0)
 A normalized vector along the positive X axis. More...
 
static readonly Vector2I UnitY = new Vector2I(0, 1)
 A normalized vector along the positive Y axis. More...
 

Properties

float Length [get]
 Floating point magnitude of the vector. More...
 
int ManhattanLength [get]
 Magnitude of the vector in Taxicab geometry. More...
 
int LengthSquared [get]
 Sum of each component squared. More...
 
Vector2F Normalized [get]
 Gets a normalized vector in the same direction as this one. More...
 
Vector2I Left [get]
 Gets a vector equal to this one rotated counter-clockwise by 90 degrees. More...
 
Vector2I Right [get]
 Gets a vector equal to this one rotated clockwise 90 degrees. More...
 
Vector2I Back [get]
 Gets a vector equal to this one rotated 180 degrees. More...
 

Detailed Description

A two component vector of integers.

Constructor & Destructor Documentation

GameAPI.Vector2I.Vector2I ( int  x,
int  y 
)
inline

Constructs a vector from the given X and Y components.

Member Function Documentation

int GameAPI.Vector2I.Dot ( Vector2I  vec)
inline

Finds the scalar product of this vector and another.

override bool GameAPI.Vector2I.Equals ( object  obj)
inline
bool GameAPI.Vector2I.Equals ( Vector2I  vec)
inline

Tests for equality with another vector.

override int GameAPI.Vector2I.GetHashCode ( )
inline
static implicit GameAPI.Vector2I.operator Vector2F ( Vector2I  vec)
inlinestatic
static Vector2I GameAPI.Vector2I.operator* ( Vector2I  a,
Vector2I  b 
)
inlinestatic

Component-wise multiplication of a vector by another.

static Vector2I GameAPI.Vector2I.operator* ( Vector2I  vec,
int  val 
)
inlinestatic

Multiplies a vector by a scalar.

static Vector2F GameAPI.Vector2I.operator* ( Vector2I  vec,
float  val 
)
inlinestatic

Multiplies a vector by a scalar.

static Vector2I GameAPI.Vector2I.operator* ( int  val,
Vector2I  vec 
)
inlinestatic

Multiplies a vector by a scalar.

static Vector2F GameAPI.Vector2I.operator* ( float  val,
Vector2I  vec 
)
inlinestatic

Multiplies a vector by a scalar.

static Vector2I GameAPI.Vector2I.operator+ ( Vector2I  vec)
inlinestatic

The identity operator.

static Vector2I GameAPI.Vector2I.operator+ ( Vector2I  a,
Vector2I  b 
)
inlinestatic

Component-wise addition of a vector to another.

static Vector2I GameAPI.Vector2I.operator- ( Vector2I  vec)
inlinestatic

Finds the negation of a vector.

static Vector2I GameAPI.Vector2I.operator- ( Vector2I  a,
Vector2I  b 
)
inlinestatic

Component-wise subtraction of a vector from another.

static Vector2I GameAPI.Vector2I.operator/ ( Vector2I  a,
Vector2I  b 
)
inlinestatic

Component-wise division of this vector by another.

static Vector2I GameAPI.Vector2I.operator/ ( Vector2I  vec,
int  val 
)
inlinestatic

Division of this vector by a scalar.

static Vector2F GameAPI.Vector2I.operator/ ( Vector2I  vec,
float  val 
)
inlinestatic
static Vector2I GameAPI.Vector2I.operator/ ( int  val,
Vector2I  vec 
)
inlinestatic
static Vector2F GameAPI.Vector2I.operator/ ( float  val,
Vector2I  vec 
)
inlinestatic
override string GameAPI.Vector2I.ToString ( )
inline

Gets a string representing this vector in (X, Y) format.

Member Data Documentation

readonly Vector2I GameAPI.Vector2I.UnitX = new Vector2I(1, 0)
static

A normalized vector along the positive X axis.

readonly Vector2I GameAPI.Vector2I.UnitY = new Vector2I(0, 1)
static

A normalized vector along the positive Y axis.

int GameAPI.Vector2I.X

Horizontal component.

int GameAPI.Vector2I.Y

Vertical component.

readonly Vector2I GameAPI.Vector2I.Zero = new Vector2I(0, 0)
static

A vector with zero for all components.

Property Documentation

Vector2I GameAPI.Vector2I.Back
get

Gets a vector equal to this one rotated 180 degrees.

Vector2I GameAPI.Vector2I.Left
get

Gets a vector equal to this one rotated counter-clockwise by 90 degrees.

float GameAPI.Vector2I.Length
get

Floating point magnitude of the vector.

int GameAPI.Vector2I.LengthSquared
get

Sum of each component squared.

int GameAPI.Vector2I.ManhattanLength
get

Magnitude of the vector in Taxicab geometry.

Vector2F GameAPI.Vector2I.Normalized
get

Gets a normalized vector in the same direction as this one.

Vector2I GameAPI.Vector2I.Right
get

Gets a vector equal to this one rotated clockwise 90 degrees.