quat [object]
A quaternion
- methods
- identity - set quaternion to identity
- multiply - multiply this quaternion with another one
- multiply_left - left-multiply this quaternion with another one
- multiply2 - multiply two matrices into this one
- invert - invert quaternion
- invert_from - invert another quaternion into this one
- rotateX - set or multiply a X-axis rotation quaternion
- rotateY - set or multiply a Y-axis rotation quaternion
- rotateZ - set or multiply a Z-axis rotation quaternion
- rotate_axis_angle - set or multiply a custom axis rotation quaternion
- rotate_axis_angle_v3 - set or multiply a custom axis rotation quaternion (vec3 argument)
- transform - transform a 3D vector
- read-only properties
- [real] length
- [real] length_squared
- [quat] normalized - return a quaternion with length = 1 if possible, length = 0 if too short
- [int] size - returns 4 - the number of components in this vector
- [mat3] mat3 - returns a 3x3 matrix, generated from this quaternion
- [mat4] mat4 - returns a 4x4 matrix, generated from this quaternion
- read/write properties
- [real] m[0-2][0-2]
- overloaded operators
- comparison between subvalues: column-major subvalue order
- other features:
- cloning support
- serialization support
- GC-safe
- indexing support for indices 0 - 8: returns/sets the specified subvalue
- tostring = "quat"
- dump:
quat(<x>;<y>;<z>|<w>)