DoopelPonger
Static Public Member Functions | List of all members
Vector2Utils Class Reference

Collection of functions around the Vectotr2 object. More...

Static Public Member Functions

static Vector2 DegreeToVector2 (float angle)
 convert an angle to a point on the unit circle. Assumes Vector2(0, 1) is 0 degrees. More...
 
static Vector2 GetSmallVariation (Vector2 direction, float jitter)
 Given a direction and a small amount of jitter to that direction. More...
 
static float AngleBetweenPoints (Vector2 initialPoint, Vector2 finalPoint)
 Find the angle difference between two points. Up is considered to be 0 degrees. Rotations are clockwise. More...
 

Detailed Description

Collection of functions around the Vectotr2 object.

Member Function Documentation

◆ AngleBetweenPoints()

static float Vector2Utils.AngleBetweenPoints ( Vector2  initialPoint,
Vector2  finalPoint 
)
static

Find the angle difference between two points. Up is considered to be 0 degrees. Rotations are clockwise.

Parameters
initialPointThe origin of the angle.
finalPointThe amount of rotation to calculate.
Returns
The angle one would need to rotate to make initialPoint to face finalPoint.

◆ DegreeToVector2()

static Vector2 Vector2Utils.DegreeToVector2 ( float  angle)
static

convert an angle to a point on the unit circle. Assumes Vector2(0, 1) is 0 degrees.

Parameters
angleAngle to be converted.
Returns
The position on the unit circle that corresponds to the angle.

◆ GetSmallVariation()

static Vector2 Vector2Utils.GetSmallVariation ( Vector2  direction,
float  jitter 
)
static

Given a direction and a small amount of jitter to that direction.

Parameters
directionThe original direction.
jitterThe amount of angular jitter to add to the direction.
Returns
The modified direction.

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