Superfighters Deluxe
Vector2 Struct Reference

Vector2 More...

Inheritance diagram for Vector2:

Public Member Functions

 Vector2 (float value)
 Constructs a new Vector2 More...
 
 Vector2 (float x, float y)
 Constructs a new Vector2 More...
 
float CalcSafeLength ()
 Calculates the length of a vector. If the vector isn't valid it returns 0. More...
 
override bool Equals (object obj)
 Compares if the components in two vectors match More...
 
bool Equals (Vector2 other)
 Compares if the components in two vectors match More...
 
override int GetHashCode ()
 
bool IsValid ()
 Checks if the X and Y components are valid and not NaN and not Infinity. More...
 
float Length ()
 Gets the length of the vector More...
 
float LengthSquared ()
 Gets the length squared of the vector More...
 
void Normalize ()
 Normalize More...
 
override string ToString ()
 

Static Public Member Functions

static void Add (ref Vector2 value1, ref Vector2 value2, out Vector2 result)
 Adds two vectors More...
 
static Vector2 Add (Vector2 value1, Vector2 value2)
 Adds two vectors More...
 
static void Distance (ref Vector2 value1, ref Vector2 value2, out float result)
 Calculates the distance between two vectors More...
 
static float Distance (Vector2 value1, Vector2 value2)
 Calculates the distance between two vectors More...
 
static void DistanceSquared (ref Vector2 value1, ref Vector2 value2, out float result)
 Calculates the squared distance between two vectors More...
 
static float DistanceSquared (Vector2 value1, Vector2 value2)
 Calculates the squared distance between two vectors More...
 
static void Divide (ref Vector2 value1, float divider, out Vector2 result)
 Divides each vector component with the divider More...
 
static void Divide (ref Vector2 value1, ref Vector2 value2, out Vector2 result)
 Divides each vector component More...
 
static Vector2 Divide (Vector2 value1, float divider)
 Divides each vector component with the divider More...
 
static Vector2 Divide (Vector2 value1, Vector2 value2)
 Divides each vector component More...
 
static void Dot (ref Vector2 value1, ref Vector2 value2, out float result)
 Calculates the dot product between two vectors More...
 
static float Dot (Vector2 value1, Vector2 value2)
 Calculates the dot product between two vectors More...
 
static void Lerp (ref Vector2 value1, ref Vector2 value2, float amount, out Vector2 result)
 Linearly interpolates between two vectors. More...
 
static Vector2 Lerp (Vector2 value1, Vector2 value2, float amount)
 Linearly interpolates between two vectors. More...
 
static void Max (ref Vector2 value1, ref Vector2 value2, out Vector2 result)
 Gets maximum components from each vector More...
 
static Vector2 Max (Vector2 value1, Vector2 value2)
 Gets maximum components from each vector More...
 
static void Min (ref Vector2 value1, ref Vector2 value2, out Vector2 result)
 Gets minimum components from each vector More...
 
static Vector2 Min (Vector2 value1, Vector2 value2)
 Gets minimum components from each vector More...
 
static void Multiply (ref Vector2 value1, float scaleFactor, out Vector2 result)
 Multiply each component More...
 
static void Multiply (ref Vector2 value1, ref Vector2 value2, out Vector2 result)
 Multiply each component More...
 
static Vector2 Multiply (Vector2 value1, float scaleFactor)
 Multiply each component More...
 
static Vector2 Multiply (Vector2 value1, Vector2 value2)
 Multiply each component More...
 
static void Negate (ref Vector2 value, out Vector2 result)
 
static Vector2 Negate (Vector2 value)
 
static void Normalize (ref Vector2 value, out Vector2 result)
 Normalize More...
 
static Vector2 Normalize (Vector2 value)
 Normalize More...
 
static bool operator!= (Vector2 value1, Vector2 value2)
 
static Vector2 operator* (float scaleFactor, Vector2 value)
 
static Vector2 operator* (Vector2 value, float scaleFactor)
 
static Vector2 operator* (Vector2 value1, Vector2 value2)
 
static Vector2 operator+ (Vector2 value1, Vector2 value2)
 
static Vector2 operator- (Vector2 value)
 
static Vector2 operator- (Vector2 value1, Vector2 value2)
 
static Vector2 operator/ (Vector2 value1, float divider)
 
static Vector2 operator/ (Vector2 value1, Vector2 value2)
 
static bool operator== (Vector2 value1, Vector2 value2)
 
static void Reflect (ref Vector2 vector, ref Vector2 normal, out Vector2 result)
 Reflect More...
 
static Vector2 Reflect (Vector2 vector, Vector2 normal)
 Reflect More...
 
static void Subtract (ref Vector2 value1, ref Vector2 value2, out Vector2 result)
 Substracts each component More...
 
static Vector2 Subtract (Vector2 value1, Vector2 value2)
 Substracts each component More...
 

Public Attributes

float X
 Gets or Sets the X component More...
 
float Y
 Gets or Sets the Y component More...
 

Properties

static Vector2 One [get]
 Unit vector one More...
 
static Vector2 UnitX [get]
 Unit vector X More...
 
static Vector2 UnitY [get]
 Unit vector Y More...
 
static Vector2 Zero [get]
 Zero vector More...
 

Detailed Description

Constructor & Destructor Documentation

◆ Vector2() [1/2]

Vector2 ( float  x,
float  y 
)

Constructs a new Vector2

Parameters
x
y

◆ Vector2() [2/2]

Vector2 ( float  value)

Constructs a new Vector2

Parameters
value

Member Function Documentation

◆ Add() [1/2]

static void Add ( ref Vector2  value1,
ref Vector2  value2,
out Vector2  result 
)
static

Adds two vectors

Parameters
value1
value2
result

◆ Add() [2/2]

static Vector2 Add ( Vector2  value1,
Vector2  value2 
)
static

Adds two vectors

Parameters
value1
value2
Returns

◆ CalcSafeLength()

float CalcSafeLength ( )

Calculates the length of a vector. If the vector isn't valid it returns 0.

Returns
length

◆ Distance() [1/2]

static void Distance ( ref Vector2  value1,
ref Vector2  value2,
out float  result 
)
static

Calculates the distance between two vectors

Parameters
value1
value2
result

◆ Distance() [2/2]

static float Distance ( Vector2  value1,
Vector2  value2 
)
static

Calculates the distance between two vectors

Parameters
value1
value2
Returns

◆ DistanceSquared() [1/2]

static void DistanceSquared ( ref Vector2  value1,
ref Vector2  value2,
out float  result 
)
static

Calculates the squared distance between two vectors

Parameters
value1
value2
result

◆ DistanceSquared() [2/2]

static float DistanceSquared ( Vector2  value1,
Vector2  value2 
)
static

Calculates the squared distance between two vectors

Parameters
value1
value2
Returns

◆ Divide() [1/4]

static void Divide ( ref Vector2  value1,
float  divider,
out Vector2  result 
)
static

Divides each vector component with the divider

Parameters
value1
divider
result

◆ Divide() [2/4]

static void Divide ( ref Vector2  value1,
ref Vector2  value2,
out Vector2  result 
)
static

Divides each vector component

Parameters
value1
value2
result

◆ Divide() [3/4]

static Vector2 Divide ( Vector2  value1,
float  divider 
)
static

Divides each vector component with the divider

Parameters
value1
divider
Returns

◆ Divide() [4/4]

static Vector2 Divide ( Vector2  value1,
Vector2  value2 
)
static

Divides each vector component

Parameters
value1
value2
Returns

◆ Dot() [1/2]

static void Dot ( ref Vector2  value1,
ref Vector2  value2,
out float  result 
)
static

Calculates the dot product between two vectors

Parameters
value1
value2
result

◆ Dot() [2/2]

static float Dot ( Vector2  value1,
Vector2  value2 
)
static

Calculates the dot product between two vectors

Parameters
value1
value2
Returns

◆ Equals() [1/2]

override bool Equals ( object  obj)

Compares if the components in two vectors match

Parameters
obj
Returns

◆ Equals() [2/2]

bool Equals ( Vector2  other)

Compares if the components in two vectors match

Parameters
other
Returns

◆ GetHashCode()

override int GetHashCode ( )

Returns

◆ IsValid()

bool IsValid ( )

Checks if the X and Y components are valid and not NaN and not Infinity.

Parameters
x
Returns

◆ Length()

float Length ( )

Gets the length of the vector

Returns

◆ LengthSquared()

float LengthSquared ( )

Gets the length squared of the vector

Returns

◆ Lerp() [1/2]

static void Lerp ( ref Vector2  value1,
ref Vector2  value2,
float  amount,
out Vector2  result 
)
static

Linearly interpolates between two vectors.

Parameters
value1
value2
Returns

◆ Lerp() [2/2]

static Vector2 Lerp ( Vector2  value1,
Vector2  value2,
float  amount 
)
static

Linearly interpolates between two vectors.

Parameters
value1
value2
Returns

◆ Max() [1/2]

static void Max ( ref Vector2  value1,
ref Vector2  value2,
out Vector2  result 
)
static

Gets maximum components from each vector

Parameters
value1
value2
result

◆ Max() [2/2]

static Vector2 Max ( Vector2  value1,
Vector2  value2 
)
static

Gets maximum components from each vector

Parameters
value1
value2
Returns

◆ Min() [1/2]

static void Min ( ref Vector2  value1,
ref Vector2  value2,
out Vector2  result 
)
static

Gets minimum components from each vector

Parameters
value1
value2
result

◆ Min() [2/2]

static Vector2 Min ( Vector2  value1,
Vector2  value2 
)
static

Gets minimum components from each vector

Parameters
value1
value2
Returns

◆ Multiply() [1/4]

static void Multiply ( ref Vector2  value1,
float  scaleFactor,
out Vector2  result 
)
static

Multiply each component

Parameters
value1
scaleFactor
result

◆ Multiply() [2/4]

static void Multiply ( ref Vector2  value1,
ref Vector2  value2,
out Vector2  result 
)
static

Multiply each component

Parameters
value1
value2
result

◆ Multiply() [3/4]

static Vector2 Multiply ( Vector2  value1,
float  scaleFactor 
)
static

Multiply each component

Parameters
value1
scaleFactor
Returns

◆ Multiply() [4/4]

static Vector2 Multiply ( Vector2  value1,
Vector2  value2 
)
static

Multiply each component

Parameters
value1
value2
Returns

◆ Negate() [1/2]

static void Negate ( ref Vector2  value,
out Vector2  result 
)
static

Parameters
value
result

◆ Negate() [2/2]

static Vector2 Negate ( Vector2  value)
static

Parameters
value
Returns

◆ Normalize() [1/3]

void Normalize ( )

Normalize

◆ Normalize() [2/3]

static void Normalize ( ref Vector2  value,
out Vector2  result 
)
static

Normalize

Parameters
value
result

◆ Normalize() [3/3]

static Vector2 Normalize ( Vector2  value)
static

Normalize

Parameters
value
Returns

◆ operator!=()

static bool operator!= ( Vector2  value1,
Vector2  value2 
)
static

Parameters
value1
value2
Returns

◆ operator*() [1/3]

static Vector2 operator* ( float  scaleFactor,
Vector2  value 
)
static

Parameters
scaleFactor
value
Returns

◆ operator*() [2/3]

static Vector2 operator* ( Vector2  value,
float  scaleFactor 
)
static

Parameters
value
scaleFactor
Returns

◆ operator*() [3/3]

static Vector2 operator* ( Vector2  value1,
Vector2  value2 
)
static

Parameters
value1
value2
Returns

◆ operator+()

static Vector2 operator+ ( Vector2  value1,
Vector2  value2 
)
static

Parameters
value1
value2
Returns

◆ operator-() [1/2]

static Vector2 operator- ( Vector2  value)
static

Parameters
value
Returns

◆ operator-() [2/2]

static Vector2 operator- ( Vector2  value1,
Vector2  value2 
)
static

Parameters
value1
value2
Returns

◆ operator/() [1/2]

static Vector2 operator/ ( Vector2  value1,
float  divider 
)
static

Parameters
value1
divider
Returns

◆ operator/() [2/2]

static Vector2 operator/ ( Vector2  value1,
Vector2  value2 
)
static

Parameters
value1
value2
Returns

◆ operator==()

static bool operator== ( Vector2  value1,
Vector2  value2 
)
static

Parameters
value1
value2
Returns

◆ Reflect() [1/2]

static void Reflect ( ref Vector2  vector,
ref Vector2  normal,
out Vector2  result 
)
static

Reflect

Parameters
vector
normal
result

◆ Reflect() [2/2]

static Vector2 Reflect ( Vector2  vector,
Vector2  normal 
)
static

Reflect

Parameters
vector
normal
Returns

◆ Subtract() [1/2]

static void Subtract ( ref Vector2  value1,
ref Vector2  value2,
out Vector2  result 
)
static

Substracts each component

Parameters
value1
value2
result

◆ Subtract() [2/2]

static Vector2 Subtract ( Vector2  value1,
Vector2  value2 
)
static

Substracts each component

Parameters
value1
value2
Returns

◆ ToString()

override string ToString ( )

Returns

Member Data Documentation

◆ X

float X

Gets or Sets the X component

◆ Y

float Y

Gets or Sets the Y component

Property Documentation

◆ One

Vector2 One
staticget

Unit vector one

◆ UnitX

Vector2 UnitX
staticget

Unit vector X

◆ UnitY

Vector2 UnitY
staticget

Unit vector Y

◆ Zero

Vector2 Zero
staticget

Zero vector