Hexagon
Loading...
Searching...
No Matches
HexVectorUtils Class Reference

Class for utility operations involving vectors:

More...

Static Public Member Functions

static Vector2 ConvertTo2D (this Vector3 vector3)
 Converts a Vector3 to a Vector2 by ignoring the Z component.
 
static Vector3 ConvertTo3D (this Vector2 vector2)
 Converts a Vector2 to a Vector3 with Z set to 0.
 
static Vector2 ConvertTo2D (this Vector2Int vector2Int)
 Converts a Vector2Int to a Vector2.
 
static Vector3 ConvertTo3D (this Vector3Int vector3Int)
 Converts a Vector3Int to a Vector3.
 
static Vector2Int RoundToInt (this Vector2 vector2)
 Rounds the components of a Vector2 to the nearest integer values and returns a Vector2Int.
 
static Vector3Int RoundToInt (this Vector3 vector3)
 Rounds the components of a Vector3 to the nearest integer values and returns a Vector3Int.
 
static Vector2Int CeilToInt (this Vector2 vector2)
 Ceils the components of a Vector2 and returns a Vector2Int.
 
static Vector3Int CeilToInt (this Vector3 vector3)
 Ceils the components of a Vector3 and returns a Vector3Int.
 
static Vector2Int FloorToInt (this Vector2 vector2)
 Floors the components of a Vector2 and returns a Vector2Int.
 
static Vector3Int FloorToInt (this Vector3 vector3)
 Floors the components of a Vector3 and returns a Vector3Int.
 
static float SqrDistance (this Vector2 a, Vector2 b)
 Calculates the squared distance between two Vector2.
 
static float SqrDistance (this Vector2Int a, Vector2Int b)
 Calculates the squared distance between two Vector2Int.
 
static float SqrDistance (this Vector3 a, Vector3 b)
 Calculates the squared distance between two Vector3.
 
static float SqrDistance (this Vector3Int a, Vector3Int b)
 Calculates the squared distance between two Vector3Int.
 
static float SqrDistanceXY (this Vector3 a, Vector3 b)
 Calculates the squared distance between two Vector3 instances in 2D space (in XY-plane).
 
static float Distance (this Vector2 a, Vector2 b)
 Calculates the distance between two Vector2.
 
static float Distance (this Vector2Int a, Vector2Int b)
 Calculates the distance between two Vector2Int.
 
static float Distance (this Vector3 a, Vector3 b)
 Calculates the distance between two Vector3.
 
static float Distance (this Vector3Int a, Vector3Int b)
 Calculates the distance between two Vector3Int.
 
static float DistanceXY (this Vector3 a, Vector3 b)
 Calculates the distance between two Vector3 instances in 2D space (in XY-plane).
 
static bool NearlyEquals (this Vector3 a, Vector3 b, double inaccuracy=1.0E-5)
 Checks if two Vector3 instances are nearly equal based on an inaccuracy tolerance.
 
static bool NearlyEquals (this Vector2 a, Vector2 b, double inaccuracy=1.0E-5)
 Checks if two Vector3 instances are nearly equal based on an inaccuracy tolerance.
 

Detailed Description

Class for utility operations involving vectors:

  • Conversion operations
  • Distance functions
  • Nearly equals functions

Member Function Documentation

◆ CeilToInt() [1/2]

static Vector2Int HexVectorUtils.CeilToInt ( this Vector2 vector2)
inlinestatic

Ceils the components of a Vector2 and returns a Vector2Int.

Returns
A new Vector2Int with ceiled integer values.

This method uses Mathf.CeilToInt.

◆ CeilToInt() [2/2]

static Vector3Int HexVectorUtils.CeilToInt ( this Vector3 vector3)
inlinestatic

Ceils the components of a Vector3 and returns a Vector3Int.

Returns
A new Vector3Int with ceiled integer values.

This method uses Mathf.CeilToInt.

◆ ConvertTo2D() [1/2]

static Vector2 HexVectorUtils.ConvertTo2D ( this Vector2Int vector2Int)
static

Converts a Vector2Int to a Vector2.

◆ ConvertTo2D() [2/2]

static Vector2 HexVectorUtils.ConvertTo2D ( this Vector3 vector3)
static

Converts a Vector3 to a Vector2 by ignoring the Z component.

◆ ConvertTo3D() [1/2]

static Vector3 HexVectorUtils.ConvertTo3D ( this Vector2 vector2)
static

Converts a Vector2 to a Vector3 with Z set to 0.

◆ ConvertTo3D() [2/2]

static Vector3 HexVectorUtils.ConvertTo3D ( this Vector3Int vector3Int)
static

Converts a Vector3Int to a Vector3.

◆ Distance() [1/4]

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

Calculates the distance between two Vector2.

◆ Distance() [2/4]

static float HexVectorUtils.Distance ( this Vector2Int a,
Vector2Int b )
static

Calculates the distance between two Vector2Int.

◆ Distance() [3/4]

static float HexVectorUtils.Distance ( this Vector3 a,
Vector3 b )
static

Calculates the distance between two Vector3.

◆ Distance() [4/4]

static float HexVectorUtils.Distance ( this Vector3Int a,
Vector3Int b )
static

Calculates the distance between two Vector3Int.

◆ DistanceXY()

static float HexVectorUtils.DistanceXY ( this Vector3 a,
Vector3 b )
static

Calculates the distance between two Vector3 instances in 2D space (in XY-plane).

◆ FloorToInt() [1/2]

static Vector2Int HexVectorUtils.FloorToInt ( this Vector2 vector2)
inlinestatic

Floors the components of a Vector2 and returns a Vector2Int.

Returns
A new Vector2Int with floored integer values.

This method uses Mathf.FloorToInt.

◆ FloorToInt() [2/2]

static Vector3Int HexVectorUtils.FloorToInt ( this Vector3 vector3)
inlinestatic

Floors the components of a Vector3 and returns a Vector3Int.

Returns
A new Vector3Int with floored integer values.

This method uses Mathf.FloorToInt.

◆ NearlyEquals() [1/2]

static bool HexVectorUtils.NearlyEquals ( this Vector2 a,
Vector2 b,
double inaccuracy = 1.0E-5 )
static

Checks if two Vector3 instances are nearly equal based on an inaccuracy tolerance.

◆ NearlyEquals() [2/2]

static bool HexVectorUtils.NearlyEquals ( this Vector3 a,
Vector3 b,
double inaccuracy = 1.0E-5 )
static

Checks if two Vector3 instances are nearly equal based on an inaccuracy tolerance.

◆ RoundToInt() [1/2]

static Vector2Int HexVectorUtils.RoundToInt ( this Vector2 vector2)
inlinestatic

Rounds the components of a Vector2 to the nearest integer values and returns a Vector2Int.

Returns
A new Vector2Int with rounded integer values.

This method uses Mathf.RoundToInt.

◆ RoundToInt() [2/2]

static Vector3Int HexVectorUtils.RoundToInt ( this Vector3 vector3)
inlinestatic

Rounds the components of a Vector3 to the nearest integer values and returns a Vector3Int.

Returns
A new Vector3Int with rounded integer values.

This method uses Mathf.RoundToInt.

◆ SqrDistance() [1/4]

static float HexVectorUtils.SqrDistance ( this Vector2 a,
Vector2 b )
static

Calculates the squared distance between two Vector2.

◆ SqrDistance() [2/4]

static float HexVectorUtils.SqrDistance ( this Vector2Int a,
Vector2Int b )
static

Calculates the squared distance between two Vector2Int.

◆ SqrDistance() [3/4]

static float HexVectorUtils.SqrDistance ( this Vector3 a,
Vector3 b )
static

Calculates the squared distance between two Vector3.

◆ SqrDistance() [4/4]

static float HexVectorUtils.SqrDistance ( this Vector3Int a,
Vector3Int b )
static

Calculates the squared distance between two Vector3Int.

◆ SqrDistanceXY()

static float HexVectorUtils.SqrDistanceXY ( this Vector3 a,
Vector3 b )
static

Calculates the squared distance between two Vector3 instances in 2D space (in XY-plane).


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