A simple quaternion struct.
public float x
(float) The x component of the quaternion.
public float y
(float) The y component of the quaternion.
public float z
(float) The z component of the quaternion.
public float w
(float) The w component of the quaternion.
public static LuaQuaternion operator * (LuaQuaternion quatLeft, LuaQuaternion quatRight)
Overload for multiplying a quaternion with a different quaternion.
Arguments
(Quaternion) The LHS quaternion. [quatLeft]
(Quaternion) The RHS quaternion. [quatRight]
Returns: (Quaternion) The multiplied quaternion.
public static LuaVector3 operator * (LuaQuaternion quat, LuaVector3 vect)
Overload for multiplying a quaternion with a vector.
Arguments
(Quaternion) The LHS quaternion. [quatLeft]
(Quaternion) The RHS vector. [quatRight]
Returns: (Vector3) The resulting vector.
public float Dot(LuaQuaternion other)
Calculate the dot product of this quaternion and another one.
Arguments
Returns: (float) The dot product of these quaternions.
public LuaVector3 Euler()
Get the euler angles of this quaternion.
Returns: (Vector3) The euler angles.
public float AngleBetween(LuaQuaternion other)
Get the angle between this quaternion and a different one.
Arguments
Returns: (float) The angle between these quaternions.
public LuaQuaternion Inverse()
Creates an inverse of this quaternion.
Returns: (Quaternion) The inverse quaternion.
public LuaQuaternion Lerp(LuaQuaternion other, float t)
Lerps this quaternion to the other quaternion by a time t.
Arguments
(Quaternion) The other quaternion. [other]
(float) The time t. [t]
Returns: (Quaternion) The lerped quaternion.
public LuaQuaternion LerpUnclamped(LuaQuaternion other, float t)
Lerps this quaternion to the other quaternion by a time t without clamping.
Arguments
(Quaternion) The other quaternion. [other]
(float) The time t. [t]
Returns: (Quaternion) The lerped quaternion.
public LuaQuaternion Slerp(LuaQuaternion other, float t)
Slerps this quaternion to the other quaternion by a time t.
Arguments
(Quaternion) The other quaternion. [other]
(float) The time t. [t]
Returns: (Quaternion) The slerped quaternion.
public LuaQuaternion SlerpUnclamped(LuaQuaternion other, float t)
Slerps this quaternion to the other quaternion by a time t without clamping.
Arguments
(Quaternion) The other quaternion. [other]
(float) The time t. [t]
Returns: (Quaternion) The slerped quaternion.
public static LuaQuaternion AngleAxis(float angle, LuaVector3 axis)
Static scope function for generating a rotation from an angle and axis.
Invoked like so: local quat = AngleAxis(90, Vector3(1, 0, 0))
Arguments
(float) The angle. [angle]
(Vector3) The axis vector. [axis]
Returns: (Quaternion) The resulting quaternion.
public static LuaQuaternion EulerToQuaternion(LuaVector3 vect)
Static scope function for generating a quaternion from euler angles.
Invoked like so: local quat = EulerToQuaternion(Vector3(0, 0, 0))
Arguments
Returns: (Quaternion) The resulting quaternion.
public static LuaQuaternion QuaternionIdentity()
Static scope function for generating a quaternion with identity rotation. Identity corresponds to "no rotation" - the rotation is perfectly aligned with the world or parent axes.
Returns: (Quaternion) Quaternion with identity rotation.