Class Vector3Extensions
SC4X Godot.Vector3 extensions
public static class Vector3Extensions
- Inheritance
-
Vector3Extensions
- Inherited Members
Methods
AngleXZ(Vector3)
returns the float angle of the XZ components of the vector. Assuming Y-up, this provides the horizontal angle for rotating to look in a particular direction. Using Node.LookAt may be better/easier but I made this so it's staying
public static float AngleXZ(this Vector3 vec)
Parameters
vec
Vector3
Returns
SetRotateX(Vector3, float)
rotates the vector along the X axis. Used for FPS camera rotation so I don't have to manually make a copy of the rotation vector every time I write a new FPS character controller. Fucking hell I've written so many god damn FPS character controllers. When will I be free of the FPS beans!?
public static Vector3 SetRotateX(this Vector3 vec, float angle)
Parameters
vec
Vector3angle
float
Returns
- Vector3
SetRotateY(Vector3, float)
rotates the vecotr along the Y axis
public static Vector3 SetRotateY(this Vector3 vec, float angle)
Parameters
vec
Vector3angle
float
Returns
- Vector3
SetRotateZ(Vector3, float)
Rotates the vector along the Z axis.
public static Vector3 SetRotateZ(this Vector3 vec, float angle)
Parameters
vec
Vector3angle
float
Returns
- Vector3