A simple three-dimensional vector.
public float x, y, z;
The components of the vector.
public static LuaVector3 operator + (LuaVector3 vector1, LuaVector3 vector2)
Overload for adding the vectors.
Arguments
(Vector3) The LHS vector. [vector1]
(Vector3) The RHS vector. [vector2]
Returns: (Vector3) The resulting vector
public static LuaVector3 operator - (LuaVector3 vector1, LuaVector3 vector2)
Overload for subtracting the vectors.
Arguments
(Vector3) The LHS vector. [vector1]
(Vector3) The RHS vector. [vector2]
Returns: (Vector3) The resulting vector
public static LuaVector3 operator * (LuaVector3 vector, float scalar)
Overload for multiplying a vector with a scalar value.
Arguments
(Vector3) The LHS vector. [vector1]
(float) The scalar. [vector2]
Returns: (Vector3) The resulting vector
public static LuaVector3 operator / (LuaVector3 vector, float scalar)
Overload for dividing a vector with a scalar value.
Arguments
(Vector3) The LHS vector. [vector1]
(float) The scalar. [vector2]
Returns: (Vector3) The resulting vector
public float Dot(LuaVector3 vector)
Gets the dot product of this vector and another vector.
Arguments
Returns: (float) The dot product.
public float Angle(LuaVector3 other)
Gets the angle between this vector and a different one.
Arguments
Returns: (float) The angle between them.
public LuaVector3 Cross(LuaVector3 other)
Get the cross product of this vector and another vector.
Arguments
Returns: (Vector3) The cross product.
public float Length()
Get the length of this vector.
Returns: (float) The length of this vector.
public LuaVector3 Normalize()
Normalize this vector.
Returns: (Vector3) The normalized version of this vector.
public LuaVector3 Project(LuaVector3 normal)
Projects this vector onto another vector.
Arguments
Returns: (Vector3) The projected vector.
public LuaVector3 Lerp(LuaVector3 other, float t)
Lerps this vector to the other vector by a time t.
Arguments
(Vector3) The other vector. [other]
(float) The time t. [t]
Returns: (Vector3) The lerped vector.
public LuaVector3 LerpUnclamped(LuaVector3 other, float t)
Lerps this vector to the other vector by a time t without clamping.
Arguments
(Vector3) The other vector. [other]
(float) The time t. [t]
Returns: (Vector3) The lerped vector.
public LuaVector3 Slerp(LuaVector3 other, float t)
Slerps this vector to the other vector by a time t.
Arguments
(Vector3) The other vector. [other]
(float) The time t. [t]
Returns: (Vector3) The slerped vector.
public LuaVector3 SlerpUnclamped(LuaVector3 other, float t)
Slerps this vector to the other vector by a time t without clamping.
Arguments
(Vector3) The other vector. [other]
(float) The time t. [t]
Returns: (Vector3) The slerped vector.
public LuaVector3 MoveTowards(LuaVector3 other, float t)
Moves this vector to the other vector by a time t.
Arguments
(Vector3) The other vector. [other]
(float) The time t. [t]
Returns: (Vector3) The moved vector.
public static LuaVector3 Vector3(float x, float y, float z)
Creates a new vector.
Used like so: local vec = Vector3(0,0,0)
Arguments
(float) The x component. [x]
(float) The y component. [y]
(float) The z component. [z]
Returns: (Vector3) A vector composed from these components.
public static LuaVector3 Vector3Zero()
Shorthand for creating a Vector3 of value (0,0,0).
Returns: (Vector3) Vector3(0,0,0)
public static LuaVector3 Vector3One()
Shorthand for creating a Vector3 of value (1,1,1).
Returns: (Vector3) Vector3(1,1,1)
public static LuaVector3 Vector3Right()
Shorthand for creating a Vector3 of value (1,0,0).
Returns: (Vector3) Vector3(1,0,0)
public static LuaVector3 Vector3Left()
Shorthand for creating a Vector3 of value (-1,0,0).
Returns: (Vector3) Vector3(-1,0,0)
public static LuaVector3 Vector3Up()
Shorthand for creating a Vector3 of value (0,1,0).
Returns: (Vector3) Vector3(0,1,0)
public static LuaVector3 Vector3Down()
Shorthand for creating a Vector3 of value (0,-1,0).
Returns: (Vector3) Vector3(0,-1,0)
public static LuaVector3 Vector3Forward()
Shorthand for creating a Vector3 of value (0,0,1).
Returns: (Vector3) Vector3(0,0,1)
public static LuaVector3 Vector3Back()
Shorthand for creating a Vector3 of value (0,0,-1).
Returns: (Vector3) Vector3(0,0,-1)