Detailed Description▲
A vector4d type has x, y, z and w attributes, otherwise it is similar to the vector3d type. Please see the documentation about the vector3d type for more information.
To create a vector4d value, specify it as a "x,y,z,w" string, or define the components individually, or compose it with the Qt.vector4d() function.
The vector4d type has the following idempotent functions which can be invoked in QML:
Function Signature |
Description |
Example |
---|---|---|
real dotProduct(vector4d other) |
Returns the scalar real result of the dot product of this vector4d with the other vector4d |
Sélectionnez
|
vector4d times(matrix4x4 matrix) |
Returns the vector4d result of transforming this vector4d with the 4x4 matrix with the matrix applied post-vector |
Sélectionnez
|
vector4d times(vector4d other) |
Returns the vector4d result of multiplying this vector4d with the other vector4d |
Sélectionnez
|
vector4d times(real factor) |
Returns the vector4d result of multiplying this vector4d with the scalar factor |
Sélectionnez
|
vector4d plus(vector4d other) |
Returns the vector4d result of the addition of this vector4d with the other vector4d |
Sélectionnez
|
vector4d minus(vector4d other) |
Returns the vector4d result of the subtraction of other vector4d from this vector4d |
Sélectionnez
|
vector4d normalized() |
Returns the normalized form of this vector |
Sélectionnez
|
real length() |
Returns the scalar real value of the length of this vector3d |
Sélectionnez
|
vector2d toVector2d() |
Returns the vector2d result of converting this vector4d to a vector2d |
Sélectionnez
|
vector3d toVector3d() |
Returns the vector3d result of converting this vector4d to a vector3d |
Sélectionnez
|
bool fuzzyEquals(vector4d other, real epsilon) |
Returns true if this vector4d is approximately equal to the other vector4d. 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