unreal.Quat
¶
- class unreal.Quat(x=0.0, y=0.0, z=0.0, w=1.0)¶
Bases:
unreal.StructBase
Quaternion. note: The full C++ class is located here: EngineSourceRuntimeCorePublicMathQuat.h
C++ Source:
Module: CoreUObject
File: NoExportTypes.h
Editor Properties: (see get_editor_property/set_editor_property)
w
(float): [Read-Write] Wx
(float): [Read-Write] Xy
(float): [Read-Write] Yz
(float): [Read-Write] Z
- __add__(other)¶
Overloads:
Quat
Returns addition of Vector A and Vector B (A + B)
- __eq__(other)¶
Overloads:
Quat
Returns true if Quaternion A is equal to Quaternion B (A == B) within a specified error tolerance
- __iadd__(other)¶
Overloads:
Quat
Returns addition of Vector A and Vector B (A + B)
- __imul__(other)¶
Overloads:
Quat
Gets the result of multiplying two quaternions (A * B).Order matters when composing quaternions: C = A * B will yield a quaternion C that logically first applies B then A to any subsequent transformation (right first, then left).
@param B The Quaternion to multiply by. @return The result of multiplication (A * B).
- __isub__(other)¶
Overloads:
Quat
Returns subtraction of Vector B from Vector A (A - B)
- __mul__(other)¶
Overloads:
Quat
Gets the result of multiplying two quaternions (A * B).Order matters when composing quaternions: C = A * B will yield a quaternion C that logically first applies B then A to any subsequent transformation (right first, then left).
@param B The Quaternion to multiply by. @return The result of multiplication (A * B).
- __ne__(other)¶
Overloads:
Quat
Returns true if Quat A is not equal to Quat B (A != B) within a specified error tolerance
- __sub__(other)¶
Overloads:
Quat
Returns subtraction of Vector B from Vector A (A - B)
- ensure_shortest_arc_to(b) → None¶
Modify the quaternion to ensure that the delta between it and B represents the shortest possible rotation angle.
- Parameters
b (Quat) –
- equals(b, tolerance=0.0001) → bool¶
Returns true if Quaternion A is equal to Quaternion B (A == B) within a specified error tolerance
- euler() → Vector¶
Convert a Quaternion into floating-point Euler angles (in degrees).
- Returns
- Return type
- exp() → Quat¶
Used in combination with Log(). Assumes a quaternion with W=0 and V=theta*v (where |v| = 1). Exp(q) = (sin(theta)*v, cos(theta))
- Returns
- Return type
- get_axis_x() → Vector¶
Get the forward direction (X axis) after it has been rotated by this Quaternion.
- Returns
- Return type
- get_axis_y() → Vector¶
Get the right direction (Y axis) after it has been rotated by this Quaternion.
- Returns
- Return type
- get_axis_z() → Vector¶
Get the up direction (Z axis) after it has been rotated by this Quaternion.
- Returns
- Return type
- get_rotation_axis() → Vector¶
Get the axis of rotation of the Quaternion. This is the axis around which rotation occurs to transform the canonical coordinate system to the target orientation. For the identity Quaternion which has no such rotation, FVector(1,0,0) is returned.
- Returns
- Return type
- is_finite() → bool¶
Determine if all the values are finite (not NaN nor Inf) in this Quat.
- Returns
- Return type
- is_identity(tolerance=0.0001) → bool¶
Checks whether this Quaternion is an Identity Quaternion. Assumes Quaternion tested is normalized.
- is_non_finite() → bool¶
Determine if there are any non-finite values (NaN or Inf) in this Quat.
- Returns
- Return type
- log() → Quat¶
Quaternion with W=0 and V=theta*v. Used in combination with Exp().
- Returns
- Return type
- multiply(b) → Quat¶
Gets the result of multiplying two quaternions (A * B).
Order matters when composing quaternions: C = A * B will yield a quaternion C that logically first applies B then A to any subsequent transformation (right first, then left).
- normalize(tolerance=0.0001) → None¶
Normalize this quaternion if it is large enough as compared to the supplied tolerance. If it is too small then set it to the identity quaternion.
- Parameters
tolerance (float) – Minimum squared length of quaternion for normalization.
- normalized(tolerance=0.0001) → Quat¶
Get a normalized copy of this quaternion. If it is too small, returns an identity quaternion.
- not_equal(b, error_tolerance=0.0001) → bool¶
Returns true if Quat A is not equal to Quat B (A != B) within a specified error tolerance
- set_from_euler(euler) → None¶
Convert a vector of floating-point Euler angles (in degrees) into a Quaternion.
- Parameters
euler (Vector) – the Euler angles
- size_squared() → float¶
Get the squared length of the quaternion.
- Returns
The squared length of the quaternion.
- Return type
- vector_forward() → Vector¶
Get the forward direction (X axis) after it has been rotated by this Quaternion.
- Returns
- Return type
- vector_right() → Vector¶
Get the right direction (Y axis) after it has been rotated by this Quaternion.
- Returns
- Return type