Komodo Engine
C PROJECT_LOGO=
Komodo.Lib.Math.Vector2 Struct Reference
Inheritance diagram for Komodo.Lib.Math.Vector2:

Public Member Functions

 Vector2 (MonoGameVector2 vector)
 
 Vector2 (Vector2 vector)
 
 Vector2 (float x=0f, float y=0f)
 
override bool Equals (object obj)
 
bool Equals (Vector2 other)
 
override int GetHashCode ()
 
float Length ()
 

Static Public Member Functions

static Vector2 operator+ (Vector2 vector)
 
static Vector2 operator- (Vector2 vector)
 
static Vector2 Add (Vector2 left, Vector2 right)
 
static Vector2 operator+ (Vector2 left, Vector2 right)
 
static Vector2 Divide (Vector2 vector, float scale)
 
static Vector2 operator/ (Vector2 left, float scale)
 
static bool operator== (Vector2 left, Vector2 right)
 
static bool operator!= (Vector2 left, Vector2 right)
 
static Vector2 Multiply (Vector2 vector, float scale)
 
static Vector2 operator* (Vector2 left, float scale)
 
static Vector2 Subtract (Vector2 left, Vector2 right)
 
static Vector2 operator- (Vector2 left, Vector2 right)
 
static Vector2 Clamp (Vector2 value, Vector2 min, Vector2 max)
 
static Vector2 Transform (Vector2 vector, Matrix transform)
 
static Vector2 Transform (Vector2 vector, Quaternion transform)
 
static Vector2 Normalize (Vector2 vectorToNormalize)
 
static float Distance (Vector2 a, Vector2 b)
 
static float DistanceSquared (Vector2 a, Vector2 b)
 
static float Dot (Vector2 a, Vector2 b)
 
static Vector2 Reflect (Vector2 vectorToReflect, Vector2 normal)
 Returns the reflection of a vector over a given normal. More...
 

Static Public Attributes

static Vector2 One => new Vector2(1f, 1f)
 
static Vector2 Down => new Vector2(0f, -1f)
 
static Vector2 Left => new Vector2(-1f, 0f)
 
static Vector2 Right => new Vector2(1f, 0f)
 
static Vector2 Up => new Vector2(0f, 1f)
 
static Vector2 Zero => new Vector2()
 

Properties

MonoGameVector2 MonoGameVector [get]
 
float X [get]
 
float Y [get]
 
Vector2 XY [get]
 
Vector2 YX [get]
 

Member Function Documentation

◆ Reflect()

static Vector2 Komodo.Lib.Math.Vector2.Reflect ( Vector2  vectorToReflect,
Vector2  normal 
)
static

Returns the reflection of a vector over a given normal.

Parameters
vectorToReflectVector to reflect over the normal.
normalNormal to reflect the vector over.
Returns
Reflected vector over the the normal.