Module Core.Common.Quaternion
Functions
| Quaternion.__add (self, quat) | Calculates the sum of two quaternions. |
| Quaternion.__mul (self, value) | Multiplies the quaternion with another value. |
| Quaternion.__sub (self, quat) | Subtracts a quaternion from another. |
| Quaternion.new (self, x, y, z, w) | Creates a new quaternion. |
| Quaternion.new_euler (self, euler) | Creates a new quaternion. |
| Quaternion.nlerp (self, quat, blend) | Normalized linear interpolation. |
| Quaternion.normalize (self) | Calculates the normalized form of the quaternion. |
Tables
| Quaternion | Present rotations in three dimensions. |
| Quaternion.euler | Euler angle presentation of the quaternion. |
| Quaternion.length | Length. |
| Quaternion.w | W value. |
| Quaternion.x | X value. |
| Quaternion.y | Y value. |
| Quaternion.z | Z value. |
Functions
- Quaternion.__add (self, quat)
-
Calculates the sum of two quaternions.
Parameters
- self: Quaternion.
- quat: Quaternion.
Return value:
New quaternion. - Quaternion.__mul (self, value)
-
Multiplies the quaternion with another value. The second value can be a scalar, a vector, or another quaternion. If it is a scalar, all the components of the quaternion are multiplied by it. If it is a vector, the vector is rotated by the quaternion, and if it is another quaternion, the rotations of the quaternions are concatenated.
Parameters
- self: Quaternion.
- value: Quaternion, vector, or number.
Return value:
New quaternion or vector. - Quaternion.__sub (self, quat)
-
Subtracts a quaternion from another.
Parameters
- self: Quaternion.
- quat: Quaternion.
Return value:
New quaternion. - Quaternion.new (self, x, y, z, w)
-
Creates a new quaternion.
Parameters
- self: Quaternion class.
- x: Optional X value, default is 0.
- y: Optional Y value, default is 0.
- z: Optional Z value, default is 0.
- w: Optional W value, default is 1.
Return value:
New quaternion. - Quaternion.new_euler (self, euler)
-
Creates a new quaternion.
Parameters
- self: Quaternion class.
- euler: Euler angles.
Return value:
New quaternion. - Quaternion.nlerp (self, quat, blend)
-
Normalized linear interpolation.
Parameters
- self: Quaternion.
- quat: Quaternion.
- blend: Interpolation factor.
Return value:
New quaternion. - Quaternion.normalize (self)
-
Calculates the normalized form of the quaternion.
Parameters
- self: Quaternion.
Return value:
New quaternion.