vector3d QML Value Type
x、y、z の属性を持つ値。詳細...
| Import Statement: | import QtQuick |
詳細な説明
vector3d 型は、x 、y 、およびz という属性を持つ値を指します。
vector3d 型のプロパティは、デフォルトでゼロベクトルを持ちます。この場合、x 、y 、およびz は0 に設定されます。
vector3d 型の値を作成するには、「x,y,z」という形式の文字列として指定します:
Rotation { angle: 60; axis: "0,1,0" }または、Qt.vector3d() 関数を使用して指定します:
Rotation { angle: 60; axis: Qt.vector3d(0, 1, 0) }あるいは、x 、y 、z の各コンポーネントを個別に指定する方法もあります:
Rotation { angle: 60; axis.x: 0; axis.y: 1; axis.z: 0 }vector3d 値の各属性は、内部的には単精度浮動小数点数(float )として格納されます。
C++ と統合する場合、C++ から QML に渡される`QVector3D ` 値は自動的に `vector3d ` 値に変換され、その逆も同様であることに注意してください。
vector3d 型には、QML から呼び出すことができる以下の冪等関数があります:
| 関数のシグネチャ | 説明 | 例 |
|---|---|---|
| vector3d crossProduct(vector3d other) | this のvector3dとother のvector3dの外積の結果をvector3dとして返します | |
| real dotProduct(vector3d other) | this vector3d とother vector3d の内積の結果をスカラー実数として返します。 | |
| vector3d times(matrix4x4 matrix) | this のvector3dを、4x4のmatrix で変換した結果のvector3dを返します。行列はベクトルの後に適用されます。 | |
| vector3d times(vector3d other) | this のvector3dに、other のvector3dを乗算した結果のvector3dを返します。 | |
| vector3d times(real factor) | this のvector3dとスカラーを乗算した結果のvector3dを返します。factor | |
| vector3d plus(vector3d other) | this のvector3dとother のvector3dを加算した結果のvector3dを返します。vector3d plus(vector3d other) | |
| vector3d minus(vector3d other) | other ベクトル 3D からthis ベクトル 3D を引いた結果のベクトル 3D を返します。 | |
| vector3d normalized() | this のvector3dの正規化された形式を返します | |
| real length() | this vector3d の長さのスカラー実数値を返します。 | |
| vector2d toVector2d() | this ベクトル3dをベクトル2dに変換した結果を返します。 | |
| vector4d toVector4d() | this vector3d を vector4d に変換した結果の vector4d を返します。 | |
| bool fuzzyEquals(vector3d other, real epsilon) | this のvector3dがother のvector3dと近似的に等しい場合、trueを返します。this の各属性が、other のepsilon 以内にある場合、この近似は真となります。epsilon はオプションの引数であり、デフォルトのepsilon は0.00001であることに注意してください。 |
この値型は、QtQuick インポートによって提供されます。
「QML 値型」も参照してください 。
© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.