pyunity.values.quaternion module¶
Class to represent a rotation in 3D space.
-
class
pyunity.values.quaternion.
Quaternion
(w, x, y, z)[source]¶ Bases:
object
Class to represent a unit quaternion, also known as a versor.
Parameters: -
copy
()[source]¶ Deep copy of the Quaternion.
Returns: A deep copy Return type: Quaternion
-
normalized
()[source]¶ A normalized Quaternion, for rotations. If the length is 0, then the identity quaternion is returned.
Returns: A unit quaternion Return type: Quaternion
-
conjugate
¶ The conjugate of a unit quaternion
-
angleAxisPair
¶ Gets or sets the angle and axis pair. Tuple of form (angle, axis).
-
static
Euler
(vector)[source]¶ Create a quaternion using Euler rotations.
Parameters: vector (Vector3) – Euler rotations Returns: Generated quaternion Return type: Quaternion
-
eulerAngles
¶ Gets or sets the Euler Angles of the quaternion
-