NotifyingQuaternion class

Extension of the standard Quaternion class, implementing the ChangeNotifier functionality. This allows any interested party to be notified when the value of this quaternion changes.

This class can be used as a regular Quaternion class. However, if you do subscribe to notifications, don't forget to eventually unsubscribe in order to avoid resource leaks.

Direct modification of this quaternion's storage is not allowed.

Inheritance
Mixed in types

Constructors

NotifyingQuaternion(double x, double y, double z, double w)
Extension of the standard Quaternion class, implementing the ChangeNotifier functionality. This allows any interested party to be notified when the value of this quaternion changes.
factory
NotifyingQuaternion.axisAngle(Vector3 axis, double angle)
Extension of the standard Quaternion class, implementing the ChangeNotifier functionality. This allows any interested party to be notified when the value of this quaternion changes.
factory
NotifyingQuaternion.copy(Quaternion other)
Extension of the standard Quaternion class, implementing the ChangeNotifier functionality. This allows any interested party to be notified when the value of this quaternion changes.
factory
NotifyingQuaternion.dq(Quaternion q, Vector3 omega)
Extension of the standard Quaternion class, implementing the ChangeNotifier functionality. This allows any interested party to be notified when the value of this quaternion changes.
factory
NotifyingQuaternion.euler(double yaw, double pitch, double roll)
Extension of the standard Quaternion class, implementing the ChangeNotifier functionality. This allows any interested party to be notified when the value of this quaternion changes.
factory
NotifyingQuaternion.fromRotation(Matrix3 rotationMatrix)
Extension of the standard Quaternion class, implementing the ChangeNotifier functionality. This allows any interested party to be notified when the value of this quaternion changes.
factory

Properties

axis Vector3
axis of rotation.
no setterinherited
hashCode int
The hash code for this object.
no setterinherited
hasListeners bool
Whether any listeners are currently registered.
no setterinherited
length double
Length.
no setterinherited
length2 double
Length squared.
no setterinherited
radians double
radians of rotation around the axis of the rotation.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
storage Float32List
Access the internal storage of the quaternions components.
no setteroverride
w double
Access the w component of the quaternion.
getter/setter pairinherited-getteroverride-setter
x double
Access the x component of the quaternion.
getter/setter pairinherited-getteroverride-setter
y double
Access the y component of the quaternion.
getter/setter pairinherited-getteroverride-setter
z double
Access the z component of the quaternion.
getter/setter pairinherited-getteroverride-setter

Methods

absoluteError(Quaternion correct) double
Absolute error between this and correct.
inherited
add(Quaternion arg) → void
Add arg to this.
override
addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
asRotationMatrix() Matrix3
Returns a rotation matrix containing the same rotation as this.
inherited
clone() Quaternion
Returns a new copy of this.
inherited
conjugate() → void
Conjugate this.
override
conjugated() Quaternion
Conjugated copy of this.
inherited
copyRotationInto(Matrix3 rotationMatrix) Matrix3
Set rotationMatrix to a rotation matrix containing the same rotation as this.
inherited
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed).
inherited
inverse() → void
Invert this.
override
inverted() Quaternion
Inverted copy of this.
inherited
normalize() double
Normalize this.
override
normalized() Quaternion
Normalized copy of this.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
relativeError(Quaternion correct) double
Relative error between this and correct.
inherited
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
rotate(Vector3 v) Vector3
Rotates v by this.
inherited
rotated(Vector3 v) Vector3
Returns a copy of v rotated by quaternion.
inherited
scale(double scale) → void
Scales this by scale.
override
scaled(double scale) Quaternion
Scaled copy of this.
inherited
setAxisAngle(Vector3 axis, double radians) → void
Set the quaternion with rotation of radians around axis.
override
setDQ(Quaternion q, Vector3 omega) → void
Set the quaternion to the time derivative of q with angular velocity omega.
override
setEuler(double yaw, double pitch, double roll) → void
Set quaternion with rotation of yaw, pitch and roll.
override
setFrom(Quaternion source) → void
Copy source into this.
override
setFromRotation(Matrix3 rotationMatrix) → void
Set the quaternion with rotation from a rotation matrix rotationMatrix.
override
setFromTwoVectors(Vector3 a, Vector3 b) → void
override
setRandom(Random rn) → void
Set the quaternion to a random rotation. The random number generator rn is used to generate the random numbers for the rotation.
override
setValues(double x, double y, double z, double w) → void
Set the quaternion to the raw values x, y, z, and w.
override
sub(Quaternion arg) → void
Subtracts arg from this.
override
toString() String
Printable string.
inherited

Operators

operator *(Quaternion other) Quaternion
this rotated by other.
inherited
operator +(Quaternion other) Quaternion
Returns copy of this + other.
inherited
operator -(Quaternion other) Quaternion
Returns copy of this - other.
inherited
operator ==(Object other) bool
The equality operator.
inherited
operator [](int i) double
Access the component of the quaternion at the index i.
inherited
operator []=(int i, double arg) → void
Set the component of the quaternion at the index i.
override
operator unary-() Quaternion
Returns negated copy of this.
inherited