Big Tony
BigTony.Utility.Vector2 Class Reference

Public Member Functions

 Vector2 ()
 Creates an empty Vector2. More...
 
 Vector2 (float _x, float _y)
 Creates a Vector2 with an 'x' and 'y' values specified. More...
 

Static Public Member Functions

static Vector2 operator+ (Vector2 a, Vector2 b)
 Add two Vector2's together. More...
 
static Vector2 operator- (Vector2 a, Vector2 b)
 Subtract a Vector2 from another. More...
 
static Vector2 operator/ (Vector2 a, Vector2 b)
 Divide a Vector2 from another. Note, if B has any axis-values equal to 0, a DivideByZeroException will be thrown. More...
 
static Vector2 operator* (Vector2 a, Vector2 b)
 Multiply a Vector2 with another. More...
 
static Vector2 operator* (Vector2 a, float b)
 Multiply a Vector2 with a floating-point number. More...
 
static Vector2 operator/ (Vector2 a, float b)
 Divide a Vector2 by a floating-point number. Note, if B is equal to zero, a DivideByZeroException will be thrown. More...
 

Public Attributes

float x
 
float y
 

Constructor & Destructor Documentation

◆ Vector2() [1/2]

BigTony.Utility.Vector2.Vector2 ( )
inline

Creates an empty Vector2.

◆ Vector2() [2/2]

BigTony.Utility.Vector2.Vector2 ( float  _x,
float  _y 
)
inline

Creates a Vector2 with an 'x' and 'y' values specified.

Parameters
_xThe floating-point position on the x-axis.
_yThe floating-point position on the y-axis.

Member Function Documentation

◆ operator*() [1/2]

static Vector2 BigTony.Utility.Vector2.operator* ( Vector2  a,
float  b 
)
inlinestatic

Multiply a Vector2 with a floating-point number.

Parameters
aThe Vector to be Mutliplied.
bThe floating-point number multiplying the Vector.
Returns
The multiplied Vector.

◆ operator*() [2/2]

static Vector2 BigTony.Utility.Vector2.operator* ( Vector2  a,
Vector2  b 
)
inlinestatic

Multiply a Vector2 with another.

Parameters
aThe Vector to be Multiplied.
bThe Vector multiplying the other.
Returns
The multiplied Vector.

◆ operator+()

static Vector2 BigTony.Utility.Vector2.operator+ ( Vector2  a,
Vector2  b 
)
inlinestatic

Add two Vector2's together.

Parameters
aThe first Vector to add.
bThe second Vector to add.
Returns
The sum of the two Vectors.

◆ operator-()

static Vector2 BigTony.Utility.Vector2.operator- ( Vector2  a,
Vector2  b 
)
inlinestatic

Subtract a Vector2 from another.

Parameters
aThe original Vector.
bThe Vector that will be subtracted from the original Vector.
Returns
The difference between the two Vectors.

◆ operator/() [1/2]

static Vector2 BigTony.Utility.Vector2.operator/ ( Vector2  a,
float  b 
)
inlinestatic

Divide a Vector2 by a floating-point number. Note, if B is equal to zero, a DivideByZeroException will be thrown.

Parameters
aThe Vector in the numerator.
bThe floating-point number in the denomonator.
Returns
A divided Vector.

◆ operator/() [2/2]

static Vector2 BigTony.Utility.Vector2.operator/ ( Vector2  a,
Vector2  b 
)
inlinestatic

Divide a Vector2 from another. Note, if B has any axis-values equal to 0, a DivideByZeroException will be thrown.

Parameters
aThe Vector in the numberator place.
bThe Vector in the denomonator place.
Returns
The divided Vector.

Member Data Documentation

◆ x

float BigTony.Utility.Vector2.x

◆ y

float BigTony.Utility.Vector2.y