Class Vector3Extensions
Inheritance
object
Vector3Extensions
Namespace: TetraCreations.Core
Assembly: cs.temp.dll.dll
Syntax
public static class Vector3Extensions
Methods
Add(Vector3, float, float, float)
Increase/Decrease any point in the vector (x, y, z) without changing the others.
Declaration
public static Vector3 Add(this Vector3 vector, float x = 0, float y = 0, float z = 0)
Parameters
Type |
Name |
Description |
Vector3 |
vector |
|
float |
x |
|
float |
y |
|
float |
z |
|
Returns
Copy(Vector3)
Returns a copy of the Vector3
Declaration
public static Vector3 Copy(this Vector3 vector)
Parameters
Type |
Name |
Description |
Vector3 |
vector |
|
Returns
GetPointOnUnitSphereCap(Quaternion, float)
Get a random point on a sphare cap, limited by an angle
Declaration
public static Vector3 GetPointOnUnitSphereCap(Quaternion targetDirection, float angle)
Parameters
Type |
Name |
Description |
Quaternion |
targetDirection |
|
float |
angle |
|
Returns
GetPointOnUnitSphereCap(Vector3, float)
Get a random point on a sphare cap, limited by an angle using Quaternion.LookRotation(targetDirection) as target direction
Declaration
public static Vector3 GetPointOnUnitSphereCap(Vector3 targetDirection, float angle)
Parameters
Type |
Name |
Description |
Vector3 |
targetDirection |
|
float |
angle |
|
Returns
Log(Vector3, string)
Show the Vector3 values in the console
Declaration
public static void Log(this Vector3 vector, string prefix = "Vector3")
Parameters
Type |
Name |
Description |
Vector3 |
vector |
|
string |
prefix |
Text to show before the values
|
ToString(Vector3)
Converts a Vector3 to a string in X, Y, Z format
Declaration
public static string ToString(this Vector3 vector)
Parameters
Type |
Name |
Description |
Vector3 |
vector |
|
Returns
With(Vector3, float?, float?, float?)
Returns a new Vector3 while changing/keeping any value from the original vector (x, y, z).
Declaration
public static Vector3 With(this Vector3 vector, float? x = null, float? y = null, float? z = null)
Parameters
Type |
Name |
Description |
Vector3 |
vector |
|
float? |
x |
|
float? |
y |
|
float? |
z |
|
Returns