Quaternion class
Class representing a quaternion.
@author {@link https://github.com/Mugen87|Mugen87}
Constructors
- Quaternion([double x = 0, double y = 0, double z = 0, double w = 1])
- Constructs a new quaternion with the given values.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- length → double
-
Computes the length of this quaternion.
no setter
- matrix → Matrix3
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- squaredLength → double
-
Computes the squared length of this quaternion
no setter
-
storage
→ List<
double> -
no setter
- vector → Vector3
-
final
- w ↔ double
-
getter/setter pair
- x ↔ double
-
getter/setter pair
- y ↔ double
-
getter/setter pair
- z ↔ double
-
getter/setter pair
Methods
-
angleTo(
Quaternion q) → double - Computes the shortest angle between two rotation defined by this quaternion and the given one.
-
clone(
) → Quaternion - Creates a new quaternion and copies all values from this quaternion.
-
conjugate(
) → Quaternion - Computes the conjugate of this quaternion.
-
copy(
Quaternion q) → Quaternion - Copies all values from the given quaternion to this quaternion.
-
dot(
Quaternion q) → double - Computes the dot product of this and the given quaternion.
-
equals(
Quaternion q) → bool - Returns true if the given quaternion is deep equal with this quaternion.
-
extractRotationFromMatrix(
Matrix4 m) → Quaternion - Extracts the rotation of the given 4x4 matrix and stores it in this quaternion.
-
fromArray(
List< double> array, [int offset = 0]) → Quaternion - Sets the components of this quaternion from an array.
-
fromEuler(
double x, double y, double z) → Quaternion - Sets the components of this quaternion from the given euler angle (YXZ order).
-
fromMatrix3(
Matrix3 m) → Quaternion - Sets the components of this quaternion from the given 3x3 rotation matrix.
-
inverse(
) → Quaternion - Computes the inverse of this quaternion.
-
lookAt(
Vector3 localForward, Vector3 targetDirection, Vector3 localUp) → Quaternion - Creates a quaternion that orients an object to face towards a specified target direction.
-
multiply(
Quaternion q) → Quaternion - Multiplies this quaternion with the given quaternion.
-
multiplyQuaternions(
Quaternion a, Quaternion b) → Quaternion - Multiplies two given quaternions and stores the result in this quaternion.
-
normalize(
) → Quaternion - Normalizes this quaternion.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
premultiply(
Quaternion q) → Quaternion - Multiplies the given quaternion with this quaternion. So the order of the multiplication is switched compared to {@link Quaternion#multiply}.
-
rotateTo(
Quaternion q, double step, [double tolerance = 0.0001]) → bool - Transforms this rotation defined by this quaternion towards the target rotation defined by the given quaternion by the given angular step. The rotation will not overshoot.
-
set(
double x, double y, double z, double w) → Quaternion - Sets the given values to this quaternion.
-
slerp(
Quaternion q, double t) → Quaternion -
Spherically interpolates between this quaternion and the given quaternion by t.
The parameter t is clamped to the range
0, 1. -
toArray(
List< double> array, [int offset = 0]) → List<double> - Copies all values of this quaternion to the given array.
-
toEuler(
Map< String, dynamic> euler) → Map<String, dynamic> - Returns an euler angel (YXZ order) representation of this quaternion.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited