C# Class Artemis.Engine.Maths.Geometry.VectorUtils

Datei anzeigen Open project: ArtemisEngine/Artemis-Engine

Public Properties

Property Type Description
Down Vector2
GameWorldDown Vector2
GameWorldUp Vector2
Left Vector2
Ones Vector2
Right Vector2
Up Vector2

Public Methods

Method Description
ComponentwiseProduct ( Vector2 a, Vector2 b ) : Vector2
Polar ( double angle, Vector2 origin, bool degrees = true ) : Vector2

Return the unit vector pointing at the given angle relative to the positive x-axis, centered at the given origin.

Polar ( double angle, bool degrees = true ) : Vector2

Return the unit vector pointing at the given angle relative to the positive x-axis.

Rotate ( Vector2 vec, double angle, Vector2 origin, bool degrees = true, bool absoluteOrigin = true ) : Vector2

Rotate a vector by the given amount relative to the given point, and return the result.

Scale ( Vector2 vec, double amount, Vector2 origin, bool absoluteOrigin = true ) : Vector2

Scale a vector by the given amount relative to the given point, and return the result.

ToNormalized ( Vector2 vec ) : Vector2

Return the normalization of a given vector.

ToVec ( Point p ) : Vector2
ToVec ( System p ) : Vector2

Method Details

ComponentwiseProduct() public static method

public static ComponentwiseProduct ( Vector2 a, Vector2 b ) : Vector2
a Vector2
b Vector2
return Vector2

Polar() public static method

Return the unit vector pointing at the given angle relative to the positive x-axis, centered at the given origin.
public static Polar ( double angle, Vector2 origin, bool degrees = true ) : Vector2
angle double
origin Vector2
degrees bool
return Vector2

Polar() public static method

Return the unit vector pointing at the given angle relative to the positive x-axis.
public static Polar ( double angle, bool degrees = true ) : Vector2
angle double
degrees bool
return Vector2

Rotate() public static method

Rotate a vector by the given amount relative to the given point, and return the result.
public static Rotate ( Vector2 vec, double angle, Vector2 origin, bool degrees = true, bool absoluteOrigin = true ) : Vector2
vec Vector2
angle double
origin Vector2
degrees bool
absoluteOrigin bool
return Vector2

Scale() public static method

Scale a vector by the given amount relative to the given point, and return the result.
public static Scale ( Vector2 vec, double amount, Vector2 origin, bool absoluteOrigin = true ) : Vector2
vec Vector2
amount double
origin Vector2
absoluteOrigin bool
return Vector2

ToNormalized() public static method

Return the normalization of a given vector.
public static ToNormalized ( Vector2 vec ) : Vector2
vec Vector2
return Vector2

ToVec() public static method

public static ToVec ( Point p ) : Vector2
p Point
return Vector2

ToVec() public static method

public static ToVec ( System p ) : Vector2
p System
return Vector2

Property Details

Down public_oe static_oe property

The unit vector point down (<0, -1>).
public static Vector2 Down
return Vector2

GameWorldDown public_oe static_oe property

The down direction relative to the game world. Since the game coordinate space is flipped on it's y-axis, this corresponds to the vector <0, 1>.
public static Vector2 GameWorldDown
return Vector2

GameWorldUp public_oe static_oe property

The up direction relative to the game world. Since the game coordinate space is flipped on it's y-axis, this corresponds to the vector <0, -1>.
public static Vector2 GameWorldUp
return Vector2

Left public_oe static_oe property

The unit vector pointing left (<-1, 0>).
public static Vector2 Left
return Vector2

Ones public_oe static_oe property

public static Vector2 Ones
return Vector2

Right public_oe static_oe property

The unit vector pointing right (<1, 0>).
public static Vector2 Right
return Vector2

Up public_oe static_oe property

The unit vector pointing up (<0, 1>).
public static Vector2 Up
return Vector2