C# Класс Sharpex2D.Math.Vector2

Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Abs ( Vector2 a ) : Vector2

Returns the absolute values of the specified vector.

Clamp ( Vector2 value, Vector2 min, Vector2 max ) : Vector2

Clamps the specified value.

CrossProduct ( ) : Vector2

Returns the vector cross product.

Dot ( Vector2 a, Vector2 b ) : float

Returns the dot product for the specified vectors.

Equals ( object obj ) : bool

Determines whether the specified System.Object is equal to this instance.

GetHashCode ( ) : int

Returns a hash code for this instance.

Lerp ( Vector2 a, Vector2 b, float amount ) : Vector2

Linear interpolation between the two values.

Max ( Vector2 a, Vector2 b ) : Vector2

Returns the greater components of the two values.

Min ( Vector2 a, Vector2 b ) : Vector2

Returns the lesser components of the two values.

Negate ( Vector2 vector ) : Vector2

Negates the specified vector.

Normalize ( Vector2 a ) : Vector2

Normalizes the specified vector.

Normalize ( ) : void

Normalizes this vector.

Reflect ( Vector2 vector, Vector2 normal ) : Vector2

Reflects the specified vector.

Rotate ( Vector2 vector, float angle ) : Vector2

Rotates the specified vector.

Round ( Vector2 vector ) : Vector2

Rounds the specified vector.

SmoothStep ( Vector2 a, Vector2 b, float amount ) : Vector2

Interpolates between two values using a cubic equation.

ToString ( ) : string

Returns a System.String that represents this instance.

Translate ( Vector2 translation ) : void

Translates the vector.

Truncate ( Vector2 a ) : Vector2

Truncates the specified vector and removes all decimal places.

Vector2 ( float value ) : System

Initializes a new instance of the Vector2 struct.

Vector2 ( float x, float y ) : System

Initializes a new instance of the Vector2 struct.

VectorProduct ( Vector2 left, Vector2 right ) : float

Returns the vector product.

operator ( ) : Vector2

Implements the operator *.

operator ( ) : bool

Implements the operator !=.

Описание методов

Abs() публичный статический Метод

Returns the absolute values of the specified vector.
public static Abs ( Vector2 a ) : Vector2
a Vector2 The vector.
Результат Vector2

Clamp() публичный статический Метод

Clamps the specified value.
public static Clamp ( Vector2 value, Vector2 min, Vector2 max ) : Vector2
value Vector2 The value.
min Vector2 The min.
max Vector2 The max.
Результат Vector2

CrossProduct() публичный Метод

Returns the vector cross product.
public CrossProduct ( ) : Vector2
Результат Vector2

Dot() публичный статический Метод

Returns the dot product for the specified vectors.
public static Dot ( Vector2 a, Vector2 b ) : float
a Vector2 The first value.
b Vector2 The second value.
Результат float

Equals() публичный Метод

Determines whether the specified System.Object is equal to this instance.
public Equals ( object obj ) : bool
obj object The to compare with this instance.
Результат bool

GetHashCode() публичный Метод

Returns a hash code for this instance.
public GetHashCode ( ) : int
Результат int

Lerp() публичный статический Метод

Linear interpolation between the two values.
public static Lerp ( Vector2 a, Vector2 b, float amount ) : Vector2
a Vector2 The first value.
b Vector2 The second value.
amount float The amount.
Результат Vector2

Max() публичный статический Метод

Returns the greater components of the two values.
public static Max ( Vector2 a, Vector2 b ) : Vector2
a Vector2 The first value.
b Vector2 The second value.
Результат Vector2

Min() публичный статический Метод

Returns the lesser components of the two values.
public static Min ( Vector2 a, Vector2 b ) : Vector2
a Vector2 The first value.
b Vector2 The second value.
Результат Vector2

Negate() публичный статический Метод

Negates the specified vector.
public static Negate ( Vector2 vector ) : Vector2
vector Vector2 The vector.
Результат Vector2

Normalize() публичный статический Метод

Normalizes the specified vector.
public static Normalize ( Vector2 a ) : Vector2
a Vector2 The vector.
Результат Vector2

Normalize() публичный Метод

Normalizes this vector.
public Normalize ( ) : void
Результат void

Reflect() публичный статический Метод

Reflects the specified vector.
public static Reflect ( Vector2 vector, Vector2 normal ) : Vector2
vector Vector2 The vector.
normal Vector2 The normal.
Результат Vector2

Rotate() публичный статический Метод

Rotates the specified vector.
public static Rotate ( Vector2 vector, float angle ) : Vector2
vector Vector2 The vector.
angle float The angle.
Результат Vector2

Round() публичный статический Метод

Rounds the specified vector.
public static Round ( Vector2 vector ) : Vector2
vector Vector2 The vector.
Результат Vector2

SmoothStep() публичный статический Метод

Interpolates between two values using a cubic equation.
public static SmoothStep ( Vector2 a, Vector2 b, float amount ) : Vector2
a Vector2 The first value.
b Vector2 The second value.
amount float The amount.
Результат Vector2

ToString() публичный Метод

Returns a System.String that represents this instance.
public ToString ( ) : string
Результат string

Translate() публичный Метод

Translates the vector.
public Translate ( Vector2 translation ) : void
translation Vector2 The translation.
Результат void

Truncate() публичный статический Метод

Truncates the specified vector and removes all decimal places.
public static Truncate ( Vector2 a ) : Vector2
a Vector2 The vector.
Результат Vector2

Vector2() публичный Метод

Initializes a new instance of the Vector2 struct.
public Vector2 ( float value ) : System
value float The value.
Результат System

Vector2() публичный Метод

Initializes a new instance of the Vector2 struct.
public Vector2 ( float x, float y ) : System
x float The x.
y float The y.
Результат System

VectorProduct() публичный статический Метод

Returns the vector product.
public static VectorProduct ( Vector2 left, Vector2 right ) : float
left Vector2
right Vector2
Результат float

operator() публичный статический Метод

Implements the operator *.
public static operator ( ) : Vector2
Результат Vector2

operator() публичный статический Метод

Implements the operator !=.
public static operator ( ) : bool
Результат bool