Unravel Engine C# Reference
Loading...
Searching...
No Matches
Vector2 Struct Reference
Inheritance diagram for Vector2:

Public Member Functions

 Vector2 (float x, float y)
 
void Set (float newX, float newY)
 
void Scale (Vector2 scale)
 
void Normalize ()
 
override string ToString ()
 
string ToString (string format)
 
string ToString (string format, IFormatProvider formatProvider)
 
override int GetHashCode ()
 
override bool Equals (object other)
 
bool Equals (Vector2 other)
 
float SqrMagnitude ()
 

Static Public Member Functions

static Vector2 Lerp (Vector2 a, Vector2 b, float t)
 
static Vector2 LerpUnclamped (Vector2 a, Vector2 b, float t)
 
static Vector2 MoveTowards (Vector2 current, Vector2 target, float maxDistanceDelta)
 
static Vector2 Scale (Vector2 a, Vector2 b)
 
static Vector2 Reflect (Vector2 inDirection, Vector2 inNormal)
 
static Vector2 Perpendicular (Vector2 inDirection)
 
static float Dot (Vector2 lhs, Vector2 rhs)
 
static float Angle (Vector2 from, Vector2 to)
 
static float SignedAngle (Vector2 from, Vector2 to)
 
static float Distance (Vector2 a, Vector2 b)
 
static Vector2 ClampMagnitude (Vector2 vector, float maxLength)
 
static float SqrMagnitude (Vector2 a)
 
static Vector2 Min (Vector2 lhs, Vector2 rhs)
 
static Vector2 Max (Vector2 lhs, Vector2 rhs)
 
static Vector2 SmoothDamp (Vector2 current, Vector2 target, ref Vector2 currentVelocity, float smoothTime, float maxSpeed, float deltaTime)
 
static Vector2 operator+ (Vector2 a, Vector2 b)
 
static Vector2 operator- (Vector2 a, Vector2 b)
 
static Vector2 operator* (Vector2 a, Vector2 b)
 
static Vector2 operator/ (Vector2 a, Vector2 b)
 
static Vector2 operator- (Vector2 a)
 
static Vector2 operator* (Vector2 a, float d)
 
static Vector2 operator* (float d, Vector2 a)
 
static Vector2 operator/ (Vector2 a, float d)
 
static bool operator== (Vector2 lhs, Vector2 rhs)
 
static bool operator!= (Vector2 lhs, Vector2 rhs)
 
static implicit operator Vector2 (Vector3 v)
 
static implicit operator Vector3 (Vector2 v)
 

Public Attributes

float x
 
float y
 

Properties

float this[int index] [get, set]
 
Vector2 normalized [get]
 
float magnitude [get]
 
float sqrMagnitude [get]
 
static Vector2 zero [get]
 
static Vector2 one [get]
 
static Vector2 up [get]
 
static Vector2 down [get]
 
static Vector2 left [get]
 
static Vector2 right [get]
 
static Vector2 positiveInfinity [get]
 
static Vector2 negativeInfinity [get]
 

Detailed Description

Definition at line 8 of file Vector2.cs.

Constructor & Destructor Documentation

◆ Vector2()

Vector2.Vector2 ( float x,
float y )

Definition at line 211 of file Vector2.cs.

Member Function Documentation

◆ Angle()

static float Vector2.Angle ( Vector2 from,
Vector2 to )
static

Definition at line 482 of file Vector2.cs.

◆ ClampMagnitude()

static Vector2 Vector2.ClampMagnitude ( Vector2 vector,
float maxLength )
static

Definition at line 540 of file Vector2.cs.

◆ Distance()

static float Vector2.Distance ( Vector2 a,
Vector2 b )
static

Definition at line 524 of file Vector2.cs.

◆ Dot()

static float Vector2.Dot ( Vector2 lhs,
Vector2 rhs )
static

Definition at line 463 of file Vector2.cs.

◆ Equals() [1/2]

override bool Vector2.Equals ( object other)

Definition at line 405 of file Vector2.cs.

◆ Equals() [2/2]

bool Vector2.Equals ( Vector2 other)

Definition at line 416 of file Vector2.cs.

◆ GetHashCode()

override int Vector2.GetHashCode ( )

Definition at line 393 of file Vector2.cs.

◆ Lerp()

static Vector2 Vector2.Lerp ( Vector2 a,
Vector2 b,
float t )
static

Definition at line 243 of file Vector2.cs.

◆ LerpUnclamped()

static Vector2 Vector2.LerpUnclamped ( Vector2 a,
Vector2 b,
float t )
static

Definition at line 260 of file Vector2.cs.

◆ Max()

static Vector2 Vector2.Max ( Vector2 lhs,
Vector2 rhs )
static

Definition at line 589 of file Vector2.cs.

◆ Min()

static Vector2 Vector2.Min ( Vector2 lhs,
Vector2 rhs )
static

Definition at line 575 of file Vector2.cs.

◆ MoveTowards()

static Vector2 Vector2.MoveTowards ( Vector2 current,
Vector2 target,
float maxDistanceDelta )
static

Definition at line 276 of file Vector2.cs.

◆ Normalize()

void Vector2.Normalize ( )

Definition at line 321 of file Vector2.cs.

◆ operator Vector2()

static implicit Vector2.operator Vector2 ( Vector3 v)
static

Definition at line 699 of file Vector2.cs.

◆ operator Vector3()

static implicit Vector2.operator Vector3 ( Vector2 v)
static

Definition at line 705 of file Vector2.cs.

◆ operator!=()

static bool Vector2.operator!= ( Vector2 lhs,
Vector2 rhs )
static

Definition at line 693 of file Vector2.cs.

◆ operator*() [1/3]

static Vector2 Vector2.operator* ( float d,
Vector2 a )
static

Definition at line 673 of file Vector2.cs.

◆ operator*() [2/3]

static Vector2 Vector2.operator* ( Vector2 a,
float d )
static

Definition at line 667 of file Vector2.cs.

◆ operator*() [3/3]

static Vector2 Vector2.operator* ( Vector2 a,
Vector2 b )
static

Definition at line 649 of file Vector2.cs.

◆ operator+()

static Vector2 Vector2.operator+ ( Vector2 a,
Vector2 b )
static

Definition at line 637 of file Vector2.cs.

◆ operator-() [1/2]

static Vector2 Vector2.operator- ( Vector2 a)
static

Definition at line 661 of file Vector2.cs.

◆ operator-() [2/2]

static Vector2 Vector2.operator- ( Vector2 a,
Vector2 b )
static

Definition at line 643 of file Vector2.cs.

◆ operator/() [1/2]

static Vector2 Vector2.operator/ ( Vector2 a,
float d )
static

Definition at line 679 of file Vector2.cs.

◆ operator/() [2/2]

static Vector2 Vector2.operator/ ( Vector2 a,
Vector2 b )
static

Definition at line 655 of file Vector2.cs.

◆ operator==()

static bool Vector2.operator== ( Vector2 lhs,
Vector2 rhs )
static

Definition at line 685 of file Vector2.cs.

◆ Perpendicular()

static Vector2 Vector2.Perpendicular ( Vector2 inDirection)
static

Definition at line 449 of file Vector2.cs.

◆ Reflect()

static Vector2 Vector2.Reflect ( Vector2 inDirection,
Vector2 inNormal )
static

Definition at line 430 of file Vector2.cs.

◆ Scale() [1/2]

static Vector2 Vector2.Scale ( Vector2 a,
Vector2 b )
static

Definition at line 299 of file Vector2.cs.

◆ Scale() [2/2]

void Vector2.Scale ( Vector2 scale)

Definition at line 311 of file Vector2.cs.

◆ Set()

void Vector2.Set ( float newX,
float newY )

Definition at line 226 of file Vector2.cs.

◆ SignedAngle()

static float Vector2.SignedAngle ( Vector2 from,
Vector2 to )
static

Definition at line 508 of file Vector2.cs.

◆ SmoothDamp()

static Vector2 Vector2.SmoothDamp ( Vector2 current,
Vector2 target,
ref Vector2 currentVelocity,
float smoothTime,
float maxSpeed,
float deltaTime )
static

Definition at line 594 of file Vector2.cs.

◆ SqrMagnitude() [1/2]

float Vector2.SqrMagnitude ( )

Definition at line 561 of file Vector2.cs.

◆ SqrMagnitude() [2/2]

static float Vector2.SqrMagnitude ( Vector2 a)
static

Definition at line 555 of file Vector2.cs.

◆ ToString() [1/3]

override string Vector2.ToString ( )

Definition at line 345 of file Vector2.cs.

◆ ToString() [2/3]

string Vector2.ToString ( string format)

Definition at line 361 of file Vector2.cs.

◆ ToString() [3/3]

string Vector2.ToString ( string format,
IFormatProvider formatProvider )

Definition at line 377 of file Vector2.cs.

Member Data Documentation

◆ x

float Vector2.x

Definition at line 13 of file Vector2.cs.

◆ y

float Vector2.y

Definition at line 18 of file Vector2.cs.

Property Documentation

◆ down

Vector2 Vector2.down
staticget

Definition at line 145 of file Vector2.cs.

◆ left

Vector2 Vector2.left
staticget

Definition at line 157 of file Vector2.cs.

◆ magnitude

float Vector2.magnitude
get

Definition at line 85 of file Vector2.cs.

◆ negativeInfinity

Vector2 Vector2.negativeInfinity
staticget

Definition at line 193 of file Vector2.cs.

◆ normalized

Vector2 Vector2.normalized
get

Definition at line 71 of file Vector2.cs.

◆ one

Vector2 Vector2.one
staticget

Definition at line 121 of file Vector2.cs.

◆ positiveInfinity

Vector2 Vector2.positiveInfinity
staticget

Definition at line 181 of file Vector2.cs.

◆ right

Vector2 Vector2.right
staticget

Definition at line 169 of file Vector2.cs.

◆ sqrMagnitude

float Vector2.sqrMagnitude
get

Definition at line 97 of file Vector2.cs.

◆ this[int index]

float Vector2.this[int index]
getset

Definition at line 36 of file Vector2.cs.

◆ up

Vector2 Vector2.up
staticget

Definition at line 133 of file Vector2.cs.

◆ zero

Vector2 Vector2.zero
staticget

Definition at line 109 of file Vector2.cs.


The documentation for this struct was generated from the following file: