Class Vectors
Inheritance
System.Object
Vectors
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Assembly: GameKit.Dependencies.dll
Syntax
public static class Vectors
Methods
Add(Vector3, Vector2)
Adds a Vector2 X/Y onto a Vector3.
Declaration
public static Vector3 Add(this Vector3 v3, Vector2 v2)
Parameters
| Type |
Name |
Description |
| UnityEngine.Vector3 |
v3 |
|
| UnityEngine.Vector2 |
v2 |
|
Returns
| Type |
Description |
| UnityEngine.Vector3 |
|
FastDistance(Vector3, Vector3)
Declaration
public static float FastDistance(Vector3 a, Vector3 b)
Parameters
| Type |
Name |
Description |
| UnityEngine.Vector3 |
a |
|
| UnityEngine.Vector3 |
b |
|
Returns
| Type |
Description |
| System.Single |
|
FastNormalize(Vector3)
Declaration
public static Vector3 FastNormalize(Vector3 value)
Parameters
| Type |
Name |
Description |
| UnityEngine.Vector3 |
value |
|
Returns
| Type |
Description |
| UnityEngine.Vector3 |
|
FastSqrMagnitude(Vector3)
Declaration
public static float FastSqrMagnitude(Vector3 vector)
Parameters
| Type |
Name |
Description |
| UnityEngine.Vector3 |
vector |
|
Returns
| Type |
Description |
| System.Single |
|
GetRate(Vector2, Vector2, Single, out Single, UInt32)
Returns how fast an object must move over duration to reach goal.
Declaration
public static float GetRate(this Vector2 a, Vector2 goal, float duration, out float distance, uint interval = 1U)
Parameters
| Type |
Name |
Description |
| UnityEngine.Vector2 |
a |
|
| UnityEngine.Vector2 |
goal |
Vector3 to measure distance against.
|
| System.Single |
duration |
How long it should take to move to goal.
|
| System.Single |
distance |
|
| System.UInt32 |
interval |
A multiplier applied towards interval. Typically this is used for ticks passed.
|
Returns
| Type |
Description |
| System.Single |
|
GetRate(Vector3, Vector3, Single, out Single, UInt32)
Returns how fast an object must move over duration to reach goal.
Declaration
public static float GetRate(this Vector3 a, Vector3 b, float duration, out float distance, uint interval = 1U)
Parameters
| Type |
Name |
Description |
| UnityEngine.Vector3 |
a |
|
| UnityEngine.Vector3 |
b |
Vector3 to measure distance against.
|
| System.Single |
duration |
How long it should take to move to goal.
|
| System.Single |
distance |
|
| System.UInt32 |
interval |
A multiplier applied towards interval. Typically this is used for ticks passed.
|
Returns
| Type |
Description |
| System.Single |
|
InverseLerp(Vector3, Vector3, Vector3)
Calculates the linear parameter t that produces the interpolant value within the range [a, b].
Declaration
public static float InverseLerp(Vector3 a, Vector3 b, Vector3 value)
Parameters
| Type |
Name |
Description |
| UnityEngine.Vector3 |
a |
|
| UnityEngine.Vector3 |
b |
|
| UnityEngine.Vector3 |
value |
|
Returns
| Type |
Description |
| System.Single |
|
IsNan(Vector3)
Returns if any values within a Vector3 are NaN.
Declaration
public static bool IsNan(this Vector3 source)
Parameters
| Type |
Name |
Description |
| UnityEngine.Vector3 |
source |
|
Returns
| Type |
Description |
| System.Boolean |
|
Lerp2(Vector2[], Single)
Lerp between three Vector2 values.
Declaration
public static Vector2 Lerp2(Vector2[] vectors, float percent)
Parameters
| Type |
Name |
Description |
| UnityEngine.Vector2[] |
vectors |
|
| System.Single |
percent |
|
Returns
| Type |
Description |
| UnityEngine.Vector2 |
|
Lerp3(Vector2, Vector2, Vector2, Single)
Lerp between three Vector2 values.
Declaration
public static Vector2 Lerp3(Vector2 a, Vector2 b, Vector2 c, float percent)
Parameters
| Type |
Name |
Description |
| UnityEngine.Vector2 |
a |
|
| UnityEngine.Vector2 |
b |
|
| UnityEngine.Vector2 |
c |
|
| System.Single |
percent |
|
Returns
| Type |
Description |
| UnityEngine.Vector2 |
|
Lerp3(Vector3, Vector3, Vector3, Single)
Lerp between three Vector3 values.
Declaration
public static Vector3 Lerp3(Vector3 a, Vector3 b, Vector3 c, float percent)
Parameters
| Type |
Name |
Description |
| UnityEngine.Vector3 |
a |
|
| UnityEngine.Vector3 |
b |
|
| UnityEngine.Vector3 |
c |
|
| System.Single |
percent |
|
Returns
| Type |
Description |
| UnityEngine.Vector3 |
|
Lerp3(Vector3[], Single)
Lerp between three Vector3 values.
Declaration
public static Vector3 Lerp3(Vector3[] vectors, float percent)
Parameters
| Type |
Name |
Description |
| UnityEngine.Vector3[] |
vectors |
|
| System.Single |
percent |
|
Returns
| Type |
Description |
| UnityEngine.Vector3 |
|
Multiply(Vector2, Vector2)
Multiplies a Vector2 by another.
Declaration
public static Vector2 Multiply(this Vector2 src, Vector2 multiplier)
Parameters
| Type |
Name |
Description |
| UnityEngine.Vector2 |
src |
|
| UnityEngine.Vector2 |
multiplier |
|
Returns
| Type |
Description |
| UnityEngine.Vector2 |
|
Multiply(Vector3, Vector3)
Multiplies a Vector3 by another.
Declaration
public static Vector3 Multiply(this Vector3 src, Vector3 multiplier)
Parameters
| Type |
Name |
Description |
| UnityEngine.Vector3 |
src |
|
| UnityEngine.Vector3 |
multiplier |
|
Returns
| Type |
Description |
| UnityEngine.Vector3 |
|
Near(Vector3, Vector3, Single)
Returns if the target Vector3 is within variance of the source Vector3.
Declaration
public static bool Near(this Vector3 a, Vector3 b, float tolerance = 0.01F)
Parameters
| Type |
Name |
Description |
| UnityEngine.Vector3 |
a |
Source vector.
|
| UnityEngine.Vector3 |
b |
Target vector.
|
| System.Single |
tolerance |
How close the target vector must be to be considered close.
|
Returns
| Type |
Description |
| System.Boolean |
|
Subtract(Vector3, Vector2)
Subtracts a Vector2 X/Y from a Vector3.
Declaration
public static Vector3 Subtract(this Vector3 v3, Vector2 v2)
Parameters
| Type |
Name |
Description |
| UnityEngine.Vector3 |
v3 |
|
| UnityEngine.Vector2 |
v2 |
|
Returns
| Type |
Description |
| UnityEngine.Vector3 |
|