C# Class Sharpex2D.Math.Vector2

ファイルを表示 Open project: ThuCommix/Sharpex2D Class Usage Examples

Public Methods

Method Description
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 !=.

Method Details

Abs() public static method

Returns the absolute values of the specified vector.
public static Abs ( Vector2 a ) : Vector2
a Vector2 The vector.
return Vector2

Clamp() public static method

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.
return Vector2

CrossProduct() public method

Returns the vector cross product.
public CrossProduct ( ) : Vector2
return Vector2

Dot() public static method

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.
return float

Equals() public method

Determines whether the specified System.Object is equal to this instance.
public Equals ( object obj ) : bool
obj object The to compare with this instance.
return bool

GetHashCode() public method

Returns a hash code for this instance.
public GetHashCode ( ) : int
return int

Lerp() public static method

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.
return Vector2

Max() public static method

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.
return Vector2

Min() public static method

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.
return Vector2

Negate() public static method

Negates the specified vector.
public static Negate ( Vector2 vector ) : Vector2
vector Vector2 The vector.
return Vector2

Normalize() public static method

Normalizes the specified vector.
public static Normalize ( Vector2 a ) : Vector2
a Vector2 The vector.
return Vector2

Normalize() public method

Normalizes this vector.
public Normalize ( ) : void
return void

Reflect() public static method

Reflects the specified vector.
public static Reflect ( Vector2 vector, Vector2 normal ) : Vector2
vector Vector2 The vector.
normal Vector2 The normal.
return Vector2

Rotate() public static method

Rotates the specified vector.
public static Rotate ( Vector2 vector, float angle ) : Vector2
vector Vector2 The vector.
angle float The angle.
return Vector2

Round() public static method

Rounds the specified vector.
public static Round ( Vector2 vector ) : Vector2
vector Vector2 The vector.
return Vector2

SmoothStep() public static method

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.
return Vector2

ToString() public method

Returns a System.String that represents this instance.
public ToString ( ) : string
return string

Translate() public method

Translates the vector.
public Translate ( Vector2 translation ) : void
translation Vector2 The translation.
return void

Truncate() public static method

Truncates the specified vector and removes all decimal places.
public static Truncate ( Vector2 a ) : Vector2
a Vector2 The vector.
return Vector2

Vector2() public method

Initializes a new instance of the Vector2 struct.
public Vector2 ( float value ) : System
value float The value.
return System

Vector2() public method

Initializes a new instance of the Vector2 struct.
public Vector2 ( float x, float y ) : System
x float The x.
y float The y.
return System

VectorProduct() public static method

Returns the vector product.
public static VectorProduct ( Vector2 left, Vector2 right ) : float
left Vector2
right Vector2
return float

operator() public static method

Implements the operator *.
public static operator ( ) : Vector2
return Vector2

operator() public static method

Implements the operator !=.
public static operator ( ) : bool
return bool