QuaternionBase<Q extends QuaternionBase<Q, M, V3, V4>, M extends MatrixBase<M, V3, Q, V4>, V3 extends Vector3Base<V3, M, Q, V4>, V4 extends Vector4Base<V4, Q, M, V3>> mixin

Backend-agnostic contract for QuaternionBase structs.

Must be mixed into every concrete platform implementation of a Raylib type to ensure a unified API surface across different backends.


A unit quaternion representing a 3D rotation as xi + yj + zk + w.

Superclass constraints
Mixin applications

Properties

$state RaylibTempStructState
Per-instance allocation state tracking slot keys, disposal, and identity.
finalinherited
hashCode int
The hash code for this object.
no setterinherited
length double
Euclidean length (magnitude) of this quaternion.
no setter
lengthSqr double
Squared length of this quaternion.
no setter
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
structName String
The Dart-side type name of this struct
no setterinherited
w double
Real (scalar) component
getter/setter pair
x double
Imaginary i component
getter/setter pair
y double
Imaginary j component
getter/setter pair
z double
Imaginary k component
getter/setter pair

Methods

add(Q o) → Q
Returns a new quaternion that is the component-wise sum of this and o.
addValue(num value) → Q
Returns a new quaternion with value added to each component.
clone() → Q
Returns a deep copy of this instance, preserving RaylibStructBase.originalPointer if present.
inherited
copy() → Q
Returns a deep copy of this instance without RaylibStructBase.originalPointer.
inherited
cubicHermiteSpline(Q outTangent1, Q q2, Q inTangent2, double t) → Q
Interpolates along a cubic Hermite spline between this and q2.
distance(Q o) double
Euclidean distance between this quaternion and o in 4D space.
distanceSqr(Q o) double
Squared Euclidean distance between this quaternion and o.
div(Q o) → Q
Returns a new quaternion that is the component-wise quotient of this and o.
divideBy(num o) → Q
Returns a new quaternion with all components divided by o.
dotProduct(Q o) double
Dot product of this quaternion and o.
equals(Q o) bool
Returns true if this quaternion is approximately equal to o.
format([int x0 = 0, int? y0, int? z0, int? w0]) String
Returns a formatted string representation of this quaternion.
invert() → Q
Returns the inverse (conjugate divided by squared length) of this quaternion.
lerp(Q o, double amount) → Q
Linear interpolation between this and o by amount (component-wise).
max(Q o) → Q
Returns a new quaternion with each component being the component-wise maximum of this and o.
min(Q o) → Q
Returns a new quaternion with each component being the component-wise minimum of this and o.
mul(Q o) → Q
Returns the Hamilton product of this quaternion and o.
negate() → Q
Returns a new quaternion with all components negated.
nLerp(Q o, double amount) → Q
Normalized linear interpolation between this and o by amount.
normalize() → Q
Returns a normalized (unit-length) copy of this quaternion.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
scale(num o) → Q
Returns a new quaternion with all components scaled by o.
set(num x, num y, num z, num w) → Q
Sets all components at once.
setD(Q o) → Q
Copies the fields of o into this instance and returns this.
inherited
signature() String
Returns a human-readable representation of this struct.
override
sLerp(Q o, double amount) → Q
Spherical linear interpolation between this and o by amount.
sub(Q o) → Q
Returns a new quaternion that is the component-wise difference of this and o.
subValue(num value) → Q
Returns a new quaternion with value subtracted from each component.
toArray() List<double>
Returns the components as a new double list.
toAxisAngle() → (V3, double)
Decomposes this quaternion into an axis–angle representation.
toEuler() → V3
Converts this quaternion to Euler angles (roll, pitch, yaw) in radians.
toMatrix() → M
Converts this quaternion to an equivalent rotation matrix.
toString() String
A string representation of this object.
inherited
toVector4() → V4
Converts this quaternion to a V4 with the same (x, y, z, w) components.
transform(M mat) → Q
Transforms this quaternion by the given matrix mat.

Operators

operator ==(Object other) bool
The equality operator.
inherited