UnityEssentials
Small but useful tools and features for Unity
|
Extensions for Vector More...
Static Public Member Functions | |
static Vector2 | Clone (this Vector2 v) |
Creates a new vector with the same values as the original. More... | |
static Vector2 | WithX (this Vector2 v, float x=0f) |
Creates a new vector with the same value for the 'y' parameter but a new one for the 'x'. More... | |
static Vector2 | WithY (this Vector2 v, float y=0f) |
Creates a new vector with the same value for the 'x' parameter but a new one for the 'y'. More... | |
static Vector3 | ToVector3NewX (this Vector2 v, float x=0f) |
Creates a new Vector3 keeping the values from the 'x' and 'y' parameters of the original Vector2 in that order. More... | |
static Vector3 | ToVector3NewY (this Vector2 v, float y=0f) |
Creates a new Vector3 keeping the values from the 'x' and 'y' parameters of the original Vector2 in that order. More... | |
static Vector3 | ToVector3NewZ (this Vector2 v, float z=0f) |
Creates a new Vector3 keeping the values from the 'x' and 'y' parameters of the original Vector2 in that order. More... | |
static Vector3 | Clone (this Vector3 v) |
Creates a new vector with the same values as the original. More... | |
static Vector2 | ToVector2WithoutX (this Vector3 v) |
Creates a new Vector2 keeping the values from the 'y' and 'z' parameters of the original Vector3. More... | |
static Vector2 | ToVector2WithoutY (this Vector3 v) |
Creates a new Vector2 keeping the values from the 'x' and 'z' parameters of the original Vector3. More... | |
static Vector2 | ToVector2WithoutZ (this Vector3 v) |
Creates a new Vector2 keeping the values from the 'x' and 'y' parameters of the original Vector3. More... | |
static Vector3 | WithX (this Vector3 v, float x=0f) |
Creates a new vector with the same value for the 'y' and 'z' parameter but a new one for the 'x'. More... | |
static Vector3 | WithY (this Vector3 v, float y=0f) |
Creates a new vector with the same value for the 'x' and 'z' parameter but a new one for the 'y'. More... | |
static Vector3 | WithZ (this Vector3 v, float z=0f) |
Creates a new vector with the same value for the 'x' and 'y' parameter but a new one for the 'z'. More... | |
static Vector3 | NearestPointOnLine (this Vector3 point, Vector3 origin, Vector3 end, bool clampInsideLineLength=true) |
Calculates the nearest position in a given line or segment. More... | |
static Vector3Int | ToVectorInt (this Vector3 v, bool round=false) |
Creates a new Vector3Int with the values in the original vector. More... | |
static Vector2Int | ToVectorInt (this Vector2 v, bool round=false) |
Creates a new Vector2Int with the values in the original vector. More... | |
Extensions for Vector
Definition at line 6 of file VectorExtensions.cs.
|
static |
Creates a new vector with the same values as the original.
Definition at line 12 of file VectorExtensions.cs.
|
static |
Creates a new vector with the same values as the original.
Definition at line 71 of file VectorExtensions.cs.
|
static |
Calculates the nearest position in a given line or segment.
origin | The origin point of the segment. |
end | The end point of the segment. |
clampInsideLineLength | If the result must be inside the given segment. If false, the origin and end points will be used to calculate the direction of an infinite line and the result will be within it. |
Definition at line 140 of file VectorExtensions.cs.
|
static |
Creates a new Vector2 keeping the values from the 'y' and 'z' parameters of the original Vector3.
Definition at line 80 of file VectorExtensions.cs.
|
static |
Creates a new Vector2 keeping the values from the 'x' and 'z' parameters of the original Vector3.
Definition at line 89 of file VectorExtensions.cs.
|
static |
Creates a new Vector2 keeping the values from the 'x' and 'y' parameters of the original Vector3.
Definition at line 98 of file VectorExtensions.cs.
|
static |
Creates a new Vector3 keeping the values from the 'x' and 'y' parameters of the original Vector2 in that order.
x | The desired value for the 'x' component on the new Vector 3. |
Definition at line 42 of file VectorExtensions.cs.
|
static |
Creates a new Vector3 keeping the values from the 'x' and 'y' parameters of the original Vector2 in that order.
y | The desired value for the 'y' component on the new Vector 3. |
Definition at line 52 of file VectorExtensions.cs.
|
static |
Creates a new Vector3 keeping the values from the 'x' and 'y' parameters of the original Vector2 in that order.
z | The desired value for the 'z' component on the new Vector 3. |
Definition at line 62 of file VectorExtensions.cs.
|
static |
Creates a new Vector2Int with the values in the original vector.
round | If the values should be rounded to the nearest integer. |
Definition at line 176 of file VectorExtensions.cs.
|
static |
Creates a new Vector3Int with the values in the original vector.
round | If the values should be rounded to the nearest integer. |
Definition at line 164 of file VectorExtensions.cs.
|
static |
Creates a new vector with the same value for the 'y' parameter but a new one for the 'x'.
x | The desired value for the 'x' component on the new vector. |
Definition at line 22 of file VectorExtensions.cs.
|
static |
Creates a new vector with the same value for the 'y' and 'z' parameter but a new one for the 'x'.
x | The desired value for the 'x' component on the new vector. |
Definition at line 108 of file VectorExtensions.cs.
|
static |
Creates a new vector with the same value for the 'x' parameter but a new one for the 'y'.
y | The desired value for the 'y' component on the new vector. |
Definition at line 32 of file VectorExtensions.cs.
|
static |
Creates a new vector with the same value for the 'x' and 'z' parameter but a new one for the 'y'.
y | The desired value for the 'y' component on the new vector. |
Definition at line 118 of file VectorExtensions.cs.
|
static |
Creates a new vector with the same value for the 'x' and 'y' parameter but a new one for the 'z'.
z | The desired value for the 'z' component on the new vector. |
Definition at line 128 of file VectorExtensions.cs.