C# Class GameEngine.Vector2

Datei anzeigen Open project: Kursledare/Mookieraw Class Usage Examples

Public Methods

Method Description
Distance ( Vector2 b ) : float

Calculate Distance from this Vector2 to another Vector2

Distance ( Vector2 a, Vector2 b ) : float

Calculate Distance between 2 Vector2

Normalize ( Vector2 b ) : Vector2

Calculate Unit Vector from this Vector2 to Second Vector2(A Vector2 with magnitude of 1).

Normalize ( Vector2 a, Vector2 b ) : Vector2

Calculate Unit Vector based on the 2 Vector2(A Vector2 with magnitude of 1).

Vector2 ( float x, float y ) : System
operator ( ) : Vector2

Method Details

Distance() public method

Calculate Distance from this Vector2 to another Vector2
public Distance ( Vector2 b ) : float
b Vector2 Second Vector2
return float

Distance() public static method

Calculate Distance between 2 Vector2
public static Distance ( Vector2 a, Vector2 b ) : float
a Vector2 First Vector2
b Vector2 Second Vector2
return float

Normalize() public method

Calculate Unit Vector from this Vector2 to Second Vector2(A Vector2 with magnitude of 1).
public Normalize ( Vector2 b ) : Vector2
b Vector2 Second Vector2
return Vector2

Normalize() public static method

Calculate Unit Vector based on the 2 Vector2(A Vector2 with magnitude of 1).
public static Normalize ( Vector2 a, Vector2 b ) : Vector2
a Vector2 First Vector2
b Vector2 Second Vector2
return Vector2

Vector2() public method

public Vector2 ( float x, float y ) : System
x float
y float
return System

operator() public static method

public static operator ( ) : Vector2
return Vector2