Detailed Description▲
A quaternion type has scalar, x, y and z attributes.
To create a quaternion value, specify it as a "scalar,x,y,z" string, or define the components individually, or compose it with the Qt.quaternion() function.
The quaternion type has the following idempotent functions which can be invoked in QML:
Function Signature |
Description |
Example |
---|---|---|
real dotProduct(quaternion other) |
Returns the scalar real result of the dot product of this quaternion with the other quaternion |
Sélectionnez
|
quaternion times(quaternion other) |
Returns the quaternion result of multiplying this quaternion with the other quaternion, which corresponds to applying both of the rotations |
Sélectionnez
|
vector3d times(vector3d vector) |
Returns the vector3d result of rotating the vector with this quaternion |
Sélectionnez
|
quaternion times(real factor) |
Returns the quaternion result of multiplying this quaternion with the scalar factor |
Sélectionnez
|
quaternion plus(quaternion other) |
Returns the quaternion result of the addition of this quaternion with the other quaternion |
Sélectionnez
|
quaternion minus(quaternion other) |
Returns the quaternion result of the subtraction of other quaternion from this quaternion |
Sélectionnez
|
quaternion normalized() |
Returns the normalized unit form of this quaternion |
Sélectionnez
|
quaternion inverted() |
Returns the inverse of this quaternion |
Sélectionnez
|
quaternion conjugated() |
Returns the conjugate of this quaternion |
Sélectionnez
|
real length() |
Returns the scalar real value of the length of this quaternion |
Sélectionnez
|
vector3d toEulerAngles() |
Returns the vector3d Euler angles (in degrees) that corresponds to this quaternion |
Sélectionnez
|
vector4d toVector4d() |
Returns the vector4d result of converting this quaternion to a vector4d |
Sélectionnez
|
bool fuzzyEquals(quaternion other, real epsilon) |
Returns true if this quaternion is approximately equal to the other quaternion. The approximation will be true if each attribute of this is within epsilon of other. Note that epsilon is an optional argument, the default epsilon is 0.00001. |
Sélectionnez
|
This value type is provided by the QtQuick import.
See Also▲
See also QML Value Types