MuGameFramework  1.0
MuGameFramework is a 2D game framework built upon C# and SFML
 All Classes Namespaces Files Functions Variables Enumerations Properties
MuGameFramework.Components.Vector2 Struct Reference

Represents a 2D Vector object on the screen More...

Public Member Functions

 Vector2 (float x, float y)
 Create an instance of Vector2
override bool Equals (object obj)
 Compare a Vector2 with this for equality
override int GetHashCode ()
 Get the hash code for this object
override string ToString ()
 Print out the values of a vector as a string
float Length ()
 Calculate the length of a vector using Pythagoras' theorem
void Normalize ()
 Normalize this Vector2
void Clamp (Vector2 min, Vector2 max)
 Clamp this Vector2 between two values
float Distance (Vector2 vector)
 Calculate the distance between two vectors
float DotProduct (Vector2 vector)
 Get the dot product of this and another Vector2
float AngleBetween (Vector2 vector)
 Calculate the angle between two vectors
void RotateAroundPoint (Vector2 point, float angle)
 Rotate this vector around a point

Static Public Member Functions

static implicit operator string (Vector2 value)
 Print out the values of a vector as a string
static Vector2 operator+ (Vector2 a, Vector2 b)
 Add two Vector2s together
static Vector2 operator- (Vector2 a, Vector2 b)
 Subtract two Vector2s
static Vector2 operator* (Vector2 a, Vector2 b)
 Multiply two Vector2s together
static Vector2 operator* (Vector2 a, float b)
 Multiply a scalar to a Vector2
static Vector2 operator* (float a, Vector2 b)
 Multiply a scalar to a Vector2
static Vector2 operator/ (Vector2 a, Vector2 b)
 Divide two Vector2s together
static Vector2 operator/ (Vector2 a, float b)
 Divide a scalar to a Vector2
static Vector2 operator/ (float a, Vector2 b)
 Divide a scalar to a Vector2
static bool operator== (Vector2 a, Vector2 b)
 Compare two Vector2s for equality
static bool operator!= (Vector2 a, Vector2 b)
 Compare two Vector2s for inequality
static float Length (Vector2 vector)
 Calculate the length of a vector using Pythagoras' theorem
static Vector2 Normalize (Vector2 vector)
 Get a unit vector of a Vector2
static Vector2 Clamp (Vector2 vector, Vector2 min, Vector2 max)
 Get a vector of this Vector2, clamped between two values
static float Distance (Vector2 vector1, Vector2 vector2)
 Calculate the distance between two vectors
static float DotProduct (Vector2 vector1, Vector2 vector2)
 Get the dot product of two Vector2s
static float AngleBetween (Vector2 vector1, Vector2 vector2)
 Calculate the angle between two vectors
static Vector2 RotateAroundPoint (Vector2 vector, Vector2 point, float angle)
 Rotate a vector around a point

Public Attributes

float X
 X coordinate of this Vector2 object
float Y
 Y coordinate of this Vector2 object

Static Public Attributes

static readonly Vector2 Zero = new Vector2(0, 0)
 Returns a Vector2 with the value of Zero
static readonly Vector2 One = new Vector2(1, 1)
 Returns a Vector2 with the value of (1, 1)

Detailed Description

Represents a 2D Vector object on the screen

Constructor & Destructor Documentation

MuGameFramework.Components.Vector2.Vector2 ( float  x,
float  y 
)

Create an instance of Vector2

Member Function Documentation

float MuGameFramework.Components.Vector2.AngleBetween ( Vector2  vector)

Calculate the angle between two vectors

Parameters
vector2nd Vector
Returns
Angle between the vectors (in Radians)
static float MuGameFramework.Components.Vector2.AngleBetween ( Vector2  vector1,
Vector2  vector2 
)
static

Calculate the angle between two vectors

Parameters
vector11st Vector
vector22nd Vector
Returns
Angle between the vectors (in Radians)
void MuGameFramework.Components.Vector2.Clamp ( Vector2  min,
Vector2  max 
)

Clamp this Vector2 between two values

Parameters
minMinimum vector
maxMaximum vector
static Vector2 MuGameFramework.Components.Vector2.Clamp ( Vector2  vector,
Vector2  min,
Vector2  max 
)
static

Get a vector of this Vector2, clamped between two values

Parameters
vectorVector to be clamped
minMinimum vector
maxMaximum vector
Returns
Clamped Vector2
float MuGameFramework.Components.Vector2.Distance ( Vector2  vector)

Calculate the distance between two vectors

Parameters
vector2nd vector
Returns
Distance between the vectors
static float MuGameFramework.Components.Vector2.Distance ( Vector2  vector1,
Vector2  vector2 
)
static

Calculate the distance between two vectors

Parameters
vector11st vector
vector22nd vector
Returns
Distance between the vectors
float MuGameFramework.Components.Vector2.DotProduct ( Vector2  vector)

Get the dot product of this and another Vector2

Parameters
vector2nd Vector
Returns
Dot product result
static float MuGameFramework.Components.Vector2.DotProduct ( Vector2  vector1,
Vector2  vector2 
)
static

Get the dot product of two Vector2s

Parameters
vector11st Vector
vector22nd Vector
Returns
Dot product result
override bool MuGameFramework.Components.Vector2.Equals ( object  obj)

Compare a Vector2 with this for equality

Parameters
objVector2 to compare
Returns
Result of comparison
override int MuGameFramework.Components.Vector2.GetHashCode ( )

Get the hash code for this object

Returns
The hash code for this object
float MuGameFramework.Components.Vector2.Length ( )

Calculate the length of a vector using Pythagoras' theorem

Returns
Length of the vector
static float MuGameFramework.Components.Vector2.Length ( Vector2  vector)
static

Calculate the length of a vector using Pythagoras' theorem

Parameters
vectorVector to get the length from
Returns
Length of the vector
void MuGameFramework.Components.Vector2.Normalize ( )

Normalize this Vector2

static Vector2 MuGameFramework.Components.Vector2.Normalize ( Vector2  vector)
static

Get a unit vector of a Vector2

Parameters
vectorVector to be normalized
Returns
Unit Vector2
static implicit MuGameFramework.Components.Vector2.operator string ( Vector2  value)
static

Print out the values of a vector as a string

Parameters
valueVector2 to print out
Returns
String of thus Vector2
static bool MuGameFramework.Components.Vector2.operator!= ( Vector2  a,
Vector2  b 
)
static

Compare two Vector2s for inequality

Parameters
aVector2 A to check
bVector2 B to check
Returns
Result of comparison
static Vector2 MuGameFramework.Components.Vector2.operator* ( Vector2  a,
Vector2  b 
)
static

Multiply two Vector2s together

Parameters
aVector2 A to multiply together
bVector2 B to multiply together
Returns
Final point
static Vector2 MuGameFramework.Components.Vector2.operator* ( Vector2  a,
float  b 
)
static

Multiply a scalar to a Vector2

Parameters
aVector2 A to multiply
bScalar to multiply by
Returns
Final Vector2
static Vector2 MuGameFramework.Components.Vector2.operator* ( float  a,
Vector2  b 
)
static

Multiply a scalar to a Vector2

Parameters
aScalar to multiply by
bVector2 B to multiply
Returns
Final Vector2
static Vector2 MuGameFramework.Components.Vector2.operator+ ( Vector2  a,
Vector2  b 
)
static

Add two Vector2s together

Parameters
aVector2 A to add
bVector2 B to add
Returns
Final Vector2
static Vector2 MuGameFramework.Components.Vector2.operator- ( Vector2  a,
Vector2  b 
)
static

Subtract two Vector2s

Parameters
aVector2 A to subtract
bVector2 B to subtract
Returns
Final Vector2
static Vector2 MuGameFramework.Components.Vector2.operator/ ( Vector2  a,
Vector2  b 
)
static

Divide two Vector2s together

Parameters
aVector2 A to divide together
bVector2 B to divide together
Returns
Final Vector2
static Vector2 MuGameFramework.Components.Vector2.operator/ ( Vector2  a,
float  b 
)
static

Divide a scalar to a Vector2

Parameters
aVector2 A to divide
bScalar to divide by
Returns
Final Vector2
static Vector2 MuGameFramework.Components.Vector2.operator/ ( float  a,
Vector2  b 
)
static

Divide a scalar to a Vector2

Parameters
aScalar to divide by
bVector2 B to divide
Returns
Final Vector2
static bool MuGameFramework.Components.Vector2.operator== ( Vector2  a,
Vector2  b 
)
static

Compare two Vector2s for equality

Parameters
aVector2 A to check
bVector2 B to check
Returns
Result of comparison
void MuGameFramework.Components.Vector2.RotateAroundPoint ( Vector2  point,
float  angle 
)

Rotate this vector around a point

Parameters
pointPoint to rotate around
angleAngle to rotate
static Vector2 MuGameFramework.Components.Vector2.RotateAroundPoint ( Vector2  vector,
Vector2  point,
float  angle 
)
static

Rotate a vector around a point

Parameters
vectorVector to rotate
pointPoint to rotate around
angleAngle to rotate
override string MuGameFramework.Components.Vector2.ToString ( )

Print out the values of a vector as a string

Returns
String of thus Vector2

Member Data Documentation

readonly Vector2 MuGameFramework.Components.Vector2.One = new Vector2(1, 1)
static

Returns a Vector2 with the value of (1, 1)

float MuGameFramework.Components.Vector2.X

X coordinate of this Vector2 object

float MuGameFramework.Components.Vector2.Y

Y coordinate of this Vector2 object

readonly Vector2 MuGameFramework.Components.Vector2.Zero = new Vector2(0, 0)
static

Returns a Vector2 with the value of Zero


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