pyunity.quaternion module¶
-
class
pyunity.quaternion.
Quaternion
(w, x, y, z)[source]¶ Bases:
object
Class to represent a 4D Quaternion.
- Parameters
w (float) – Real value of Quaternion
x (float) – x coordinate of Quaternion
y (float) – y coordinate of Quaternion
z (float) – z coordinate of Quaternion
-
static
Euler
(vector)[source]¶ Create a quaternion using Euler rotations.
- Parameters
vector (Vector3) – Euler rotations
- Returns
Generated quaternion
- Return type
-
static
FromAxis
(angle, a)[source]¶ Create a quaternion from an angle and an axis.
- Parameters
angle (float) – Angle to rotate
a (Vector3) – Axis to rotate about
-
property
angleAxisPair
¶ Gets or sets the angle and axis pair.
Notes
When getting, it returns a tuple in the form of
(angle, x, y, z)
. When setting, assign likeq.eulerAngles = (angle, vector)
.
-
property
conjugate
¶ The conjugate of a unit quaternion
-
property
eulerAngles
¶ Gets or sets the Euler Angles of the quaternion