Ctrl+K

Vector2

Declaration

public struct Strawberry.Math.Vector2

Implements: System.IEquatable

Constructors

Vector2

Constructor for standard 2D vector.

void Vector2(float x, float y)

Parameters:

Name Type Description
x System.Single A Single
y System.Single A Single

Vector2

void Vector2(Vector2 vec)

Parameters:

Name Type Description
vec Strawberry.Math.Vector2

Vector2

Constructor for "square" vector.

void Vector2(float value)

Parameters:

Name Type Description
value System.Single A Single

Properties

Zero static

Vector2 Zero { get }

One static

Vector2 One { get }

UnitX static

Vector2 UnitX { get }

UnitY static

Vector2 UnitY { get }

Direction

double Direction { get set }

Angle

float Angle { get }

Length

float Length { get set }

RadDir

double RadDir { get set }

Fields

X

float X

Y

float Y

Methods

Reflect static

void Reflect(ref Vector2 vector, ref Vector2 normal, out Vector2 result)

Parameters:

Name Type Description
vector ref Strawberry.Math.Vector2
normal ref Strawberry.Math.Vector2
result out Strawberry.Math.Vector2

Reflect static

Vector2 Reflect(Vector2 vector, Vector2 normal)

Parameters:

Name Type Description
vector Strawberry.Math.Vector2
normal Strawberry.Math.Vector2

Add static

Vector2 Add(Vector2 value1, Vector2 value2)

Parameters:

Name Type Description
value1 Strawberry.Math.Vector2
value2 Strawberry.Math.Vector2

Add static

void Add(ref Vector2 value1, ref Vector2 value2, out Vector2 result)

Parameters:

Name Type Description
value1 ref Strawberry.Math.Vector2
value2 ref Strawberry.Math.Vector2
result out Strawberry.Math.Vector2

Barycentric static

Vector2 Barycentric(Vector2 value1, Vector2 value2, Vector2 value3, float amount1, float amount2)

Parameters:

Name Type Description
value1 Strawberry.Math.Vector2
value2 Strawberry.Math.Vector2
value3 Strawberry.Math.Vector2
amount1 System.Single
amount2 System.Single

Barycentric static

void Barycentric(ref Vector2 value1, ref Vector2 value2, ref Vector2 value3, float amount1, float amount2, out Vector2 result)

Parameters:

Name Type Description
value1 ref Strawberry.Math.Vector2
value2 ref Strawberry.Math.Vector2
value3 ref Strawberry.Math.Vector2
amount1 System.Single
amount2 System.Single
result out Strawberry.Math.Vector2

CatmullRom static

Vector2 CatmullRom(Vector2 value1, Vector2 value2, Vector2 value3, Vector2 value4, float amount)

Parameters:

Name Type Description
value1 Strawberry.Math.Vector2
value2 Strawberry.Math.Vector2
value3 Strawberry.Math.Vector2
value4 Strawberry.Math.Vector2
amount System.Single

CatmullRom static

void CatmullRom(ref Vector2 value1, ref Vector2 value2, ref Vector2 value3, ref Vector2 value4, float amount, out Vector2 result)

Parameters:

Name Type Description
value1 ref Strawberry.Math.Vector2
value2 ref Strawberry.Math.Vector2
value3 ref Strawberry.Math.Vector2
value4 ref Strawberry.Math.Vector2
amount System.Single
result out Strawberry.Math.Vector2

Clamp static

Vector2 Clamp(Vector2 value1, Vector2 min, Vector2 max)

Parameters:

Name Type Description
value1 Strawberry.Math.Vector2
min Strawberry.Math.Vector2
max Strawberry.Math.Vector2

Clamp static

void Clamp(ref Vector2 value1, ref Vector2 min, ref Vector2 max, out Vector2 result)

Parameters:

Name Type Description
value1 ref Strawberry.Math.Vector2
min ref Strawberry.Math.Vector2
max ref Strawberry.Math.Vector2
result out Strawberry.Math.Vector2

Distance static

Returns float precison distanve between two vectors

float Distance(Vector2 value1, Vector2 value2)

Parameters:

Name Type Description
value1 Strawberry.Math.Vector2 A Vector2
value2 Strawberry.Math.Vector2 A Vector2

Returns: A Single

Distance static

void Distance(ref Vector2 value1, ref Vector2 value2, out float result)

Parameters:

Name Type Description
value1 ref Strawberry.Math.Vector2
value2 ref Strawberry.Math.Vector2
result out System.Single

DistanceSquared static

float DistanceSquared(Vector2 value1, Vector2 value2)

Parameters:

Name Type Description
value1 Strawberry.Math.Vector2
value2 Strawberry.Math.Vector2

DistanceSquared static

void DistanceSquared(ref Vector2 value1, ref Vector2 value2, out float result)

Parameters:

Name Type Description
value1 ref Strawberry.Math.Vector2
value2 ref Strawberry.Math.Vector2
result out System.Single

Divide static

Devide first vector with the secund vector

Vector2 Divide(Vector2 value1, Vector2 value2)

Parameters:

Name Type Description
value1 Strawberry.Math.Vector2 A Vector2
value2 Strawberry.Math.Vector2 A Vector2

Returns: A Vector2

Divide static

void Divide(ref Vector2 value1, ref Vector2 value2, out Vector2 result)

Parameters:

Name Type Description
value1 ref Strawberry.Math.Vector2
value2 ref Strawberry.Math.Vector2
result out Strawberry.Math.Vector2

Divide static

Vector2 Divide(Vector2 value1, float divider)

Parameters:

Name Type Description
value1 Strawberry.Math.Vector2
divider System.Single

Divide static

void Divide(ref Vector2 value1, float divider, out Vector2 result)

Parameters:

Name Type Description
value1 ref Strawberry.Math.Vector2
divider System.Single
result out Strawberry.Math.Vector2

Dot static

float Dot(Vector2 value1, Vector2 value2)

Parameters:

Name Type Description
value1 Strawberry.Math.Vector2
value2 Strawberry.Math.Vector2

Dot static

void Dot(ref Vector2 value1, ref Vector2 value2, out float result)

Parameters:

Name Type Description
value1 ref Strawberry.Math.Vector2
value2 ref Strawberry.Math.Vector2
result out System.Single

Equals override

bool Equals(object obj)

Parameters:

Name Type Description
obj System.Object

Equals

bool Equals(Vector2 other)

Parameters:

Name Type Description
other Strawberry.Math.Vector2

GetHashCode override

int GetHashCode()

Hermite static

Vector2 Hermite(Vector2 value1, Vector2 tangent1, Vector2 value2, Vector2 tangent2, float amount)

Parameters:

Name Type Description
value1 Strawberry.Math.Vector2
tangent1 Strawberry.Math.Vector2
value2 Strawberry.Math.Vector2
tangent2 Strawberry.Math.Vector2
amount System.Single

Hermite static

void Hermite(ref Vector2 value1, ref Vector2 tangent1, ref Vector2 value2, ref Vector2 tangent2, float amount, out Vector2 result)

Parameters:

Name Type Description
value1 ref Strawberry.Math.Vector2
tangent1 ref Strawberry.Math.Vector2
value2 ref Strawberry.Math.Vector2
tangent2 ref Strawberry.Math.Vector2
amount System.Single
result out Strawberry.Math.Vector2

LengthSquared

float LengthSquared()

Lerp static

Vector2 Lerp(Vector2 value1, Vector2 value2, float amount)

Parameters:

Name Type Description
value1 Strawberry.Math.Vector2
value2 Strawberry.Math.Vector2
amount System.Single

Lerp static

void Lerp(ref Vector2 value1, ref Vector2 value2, float amount, out Vector2 result)

Parameters:

Name Type Description
value1 ref Strawberry.Math.Vector2
value2 ref Strawberry.Math.Vector2
amount System.Single
result out Strawberry.Math.Vector2

Max static

Vector2 Max(Vector2 value1, Vector2 value2)

Parameters:

Name Type Description
value1 Strawberry.Math.Vector2
value2 Strawberry.Math.Vector2

Max static

void Max(ref Vector2 value1, ref Vector2 value2, out Vector2 result)

Parameters:

Name Type Description
value1 ref Strawberry.Math.Vector2
value2 ref Strawberry.Math.Vector2
result out Strawberry.Math.Vector2

Min static

Vector2 Min(Vector2 value1, Vector2 value2)

Parameters:

Name Type Description
value1 Strawberry.Math.Vector2
value2 Strawberry.Math.Vector2

Min static

void Min(ref Vector2 value1, ref Vector2 value2, out Vector2 result)

Parameters:

Name Type Description
value1 ref Strawberry.Math.Vector2
value2 ref Strawberry.Math.Vector2
result out Strawberry.Math.Vector2

Multiply static

Vector2 Multiply(Vector2 value1, Vector2 value2)

Parameters:

Name Type Description
value1 Strawberry.Math.Vector2
value2 Strawberry.Math.Vector2

Multiply static

Vector2 Multiply(Vector2 value1, float scaleFactor)

Parameters:

Name Type Description
value1 Strawberry.Math.Vector2
scaleFactor System.Single

Multiply static

void Multiply(ref Vector2 value1, float scaleFactor, out Vector2 result)

Parameters:

Name Type Description
value1 ref Strawberry.Math.Vector2
scaleFactor System.Single
result out Strawberry.Math.Vector2

Multiply static

void Multiply(ref Vector2 value1, ref Vector2 value2, out Vector2 result)

Parameters:

Name Type Description
value1 ref Strawberry.Math.Vector2
value2 ref Strawberry.Math.Vector2
result out Strawberry.Math.Vector2

Negate static

Vector2 Negate(Vector2 value)

Parameters:

Name Type Description
value Strawberry.Math.Vector2

Negate static

void Negate(ref Vector2 value, out Vector2 result)

Parameters:

Name Type Description
value ref Strawberry.Math.Vector2
result out Strawberry.Math.Vector2

Normalize

void Normalize()

Normalize static

Vector2 Normalize(Vector2 value)

Parameters:

Name Type Description
value Strawberry.Math.Vector2

Normalize static

void Normalize(ref Vector2 value, out Vector2 result)

Parameters:

Name Type Description
value ref Strawberry.Math.Vector2
result out Strawberry.Math.Vector2

SmoothStep static

Vector2 SmoothStep(Vector2 value1, Vector2 value2, float amount)

Parameters:

Name Type Description
value1 Strawberry.Math.Vector2
value2 Strawberry.Math.Vector2
amount System.Single

SmoothStep static

void SmoothStep(ref Vector2 value1, ref Vector2 value2, float amount, out Vector2 result)

Parameters:

Name Type Description
value1 ref Strawberry.Math.Vector2
value2 ref Strawberry.Math.Vector2
amount System.Single
result out Strawberry.Math.Vector2

Subtract static

Vector2 Subtract(Vector2 value1, Vector2 value2)

Parameters:

Name Type Description
value1 Strawberry.Math.Vector2
value2 Strawberry.Math.Vector2

Subtract static

void Subtract(ref Vector2 value1, ref Vector2 value2, out Vector2 result)

Parameters:

Name Type Description
value1 ref Strawberry.Math.Vector2
value2 ref Strawberry.Math.Vector2
result out Strawberry.Math.Vector2

Transform static

Vector2 Transform(Vector2 position, Matrix4 Matrix4)

Parameters:

Name Type Description
position Strawberry.Math.Vector2
Matrix4 Strawberry.Math.Matrix4

Transform static

void Transform(ref Vector2 position, ref Matrix4 Matrix4, out Vector2 result)

Parameters:

Name Type Description
position ref Strawberry.Math.Vector2
Matrix4 ref Strawberry.Math.Matrix4
result out Strawberry.Math.Vector2

Transform static

void Transform(Vector2[] sourceArray, ref Matrix4 Matrix4, Vector2[] destinationArray)

Parameters:

Name Type Description
sourceArray Strawberry.Math.Vector2[]
Matrix4 ref Strawberry.Math.Matrix4
destinationArray Strawberry.Math.Vector2[]

Transform static

void Transform(Vector2[] sourceArray, int sourceIndex, ref Matrix4 Matrix4, Vector2[] destinationArray, int destinationIndex, int length)

Parameters:

Name Type Description
sourceArray Strawberry.Math.Vector2[]
sourceIndex System.Int32
Matrix4 ref Strawberry.Math.Matrix4
destinationArray Strawberry.Math.Vector2[]
destinationIndex System.Int32
length System.Int32

TransformNormal static

Vector2 TransformNormal(Vector2 normal, Matrix4 Matrix4)

Parameters:

Name Type Description
normal Strawberry.Math.Vector2
Matrix4 Strawberry.Math.Matrix4

TransformNormal static

void TransformNormal(ref Vector2 normal, ref Matrix4 Matrix4, out Vector2 result)

Parameters:

Name Type Description
normal ref Strawberry.Math.Vector2
Matrix4 ref Strawberry.Math.Matrix4
result out Strawberry.Math.Vector2

TransformNormal static

void TransformNormal(Vector2[] sourceArray, ref Matrix4 Matrix4, Vector2[] destinationArray)

Parameters:

Name Type Description
sourceArray Strawberry.Math.Vector2[]
Matrix4 ref Strawberry.Math.Matrix4
destinationArray Strawberry.Math.Vector2[]

TransformNormal static

void TransformNormal(Vector2[] sourceArray, int sourceIndex, ref Matrix4 Matrix4, Vector2[] destinationArray, int destinationIndex, int length)

Parameters:

Name Type Description
sourceArray Strawberry.Math.Vector2[]
sourceIndex System.Int32
Matrix4 ref Strawberry.Math.Matrix4
destinationArray Strawberry.Math.Vector2[]
destinationIndex System.Int32
length System.Int32

Left static

Vector2 Left(float size = 1)

Parameters:

Name Type Description
size System.Single = 1

Right static

Vector2 Right(float size = 1)

Parameters:

Name Type Description
size System.Single = 1

Up static

Vector2 Up(float size = 1)

Parameters:

Name Type Description
size System.Single = 1

Down static

Vector2 Down(float size = 1)

Parameters:

Name Type Description
size System.Single = 1

ToString override

string ToString()

Operators

op_UnaryNegation static

Vector2 op_UnaryNegation(Vector2 value)

Parameters:

Name Type Description
value Strawberry.Math.Vector2

op_Equality static

bool op_Equality(Vector2 value1, Vector2 value2)

Parameters:

Name Type Description
value1 Strawberry.Math.Vector2
value2 Strawberry.Math.Vector2

op_Inequality static

bool op_Inequality(Vector2 value1, Vector2 value2)

Parameters:

Name Type Description
value1 Strawberry.Math.Vector2
value2 Strawberry.Math.Vector2

op_Addition static

Vector2 op_Addition(Vector2 value1, Vector2 value2)

Parameters:

Name Type Description
value1 Strawberry.Math.Vector2
value2 Strawberry.Math.Vector2

op_Subtraction static

Vector2 op_Subtraction(Vector2 value1, Vector2 value2)

Parameters:

Name Type Description
value1 Strawberry.Math.Vector2
value2 Strawberry.Math.Vector2

op_Multiply static

Vector2 op_Multiply(Vector2 value1, Vector2 value2)

Parameters:

Name Type Description
value1 Strawberry.Math.Vector2
value2 Strawberry.Math.Vector2

op_Multiply static

Vector2 op_Multiply(Vector2 value, float scaleFactor)

Parameters:

Name Type Description
value Strawberry.Math.Vector2
scaleFactor System.Single

op_Multiply static

Vector2 op_Multiply(float scaleFactor, Vector2 value)

Parameters:

Name Type Description
scaleFactor System.Single
value Strawberry.Math.Vector2

op_Division static

Vector2 op_Division(Vector2 value1, Vector2 value2)

Parameters:

Name Type Description
value1 Strawberry.Math.Vector2
value2 Strawberry.Math.Vector2

op_Division static

Vector2 op_Division(Vector2 value1, float divider)

Parameters:

Name Type Description
value1 Strawberry.Math.Vector2
divider System.Single