vector4d QML Value Type
vector4d型はx, y, z, w属性を持つ。詳細...
詳細な説明
vector4d
型はx
,y
,z
,w
属性を持ち、それ以外はvector3d
型と同様です。
vector4d
型のプロパティは、デフォルトでゼロ・ベクトルを持ちます。これにはx
,y
,z
およびw
が0
に設定されています。
詳しくはvector3d
型に関するドキュメントを参照してください。
vector4d
の値を作成するには、"x,y,z,w" の文字列として指定するか、コンポーネントを個別に定義するか、Qt.vector4d() 関数で合成します。
vector4d型には、QMLで呼び出すことのできる以下のようなべき等関数があります:
関数のシグネチャ | 説明 | 例 |
---|---|---|
real dotProduct(vector4d other) | this vector4d とother vector4d との内積をスカラー実数で返します。 | |
vector4d times(matrix4x4 matrix) | this vector4d を 4x4 で変換した vector4d の結果を返しますmatrix 行列を適用したポストベクトル | |
vector4d times(vector4d other) | this vector4d とother vector4d を乗算した vector4d の結果を返します。 | |
vector4d times(real factor) | this vector4d にスカラーを乗じた vector4d の結果を返します。factor | var a = Qt.vector4d(1,2,3,4); var b = 4.48; var c = a.times(b); console.log(c.toString()); // QVector3D(4.48, 8.96, 13.44, 17.92) |
vector4d plus(vector4d その他) | this vector4d とother vector4d を加算した vector4d の結果を返します。 | |
vector4d minus(vector4d other) | this vector4d からother vector4d を減算した vector4d の結果を返します。 | |
vector4d 正規化() | this vector の正規化形式を返します。 | var a = Qt.vector4d(1,2,3,4); var b = a.normalized(); console.log(b.toString()); // QVector4D(0.182574, 0.365148, 0.547723, 0.730297) |
real length() | this vector3d の長さのスカラー実数値を返す | var a = Qt.vector4d(1,2,3,4); var b = a.length(); console.log(b.toString()); // 5.477225575051661 |
vector2d toVector2d() | this vector4d を vector2d に変換した結果を返します。 | var a = Qt.vector4d(1,2,3,4); var b = a.toVector2d(); console.log(b.toString()); // QVector2D(1, 2) |
vector3d toVector3d() | this vector4d を vector3d に変換した vector3d 結果を返します。 | var a = Qt.vector4d(1,2,3,4); var b = a.toVector3d(); console.log(b.toString()); // QVector3D(1, 2, 3) |
bool fuzzyEquals(vector4d other, real epsilon) | this vector4d がother vector4d とほぼ等しい場合に真を返します。近似値は、this の各属性がother のepsilon 以内にある場合に真となります。epsilon はオプション引数であることに注意してください。デフォルトのepsilon は 0.00001 です。 |
この値型はQtQuick インポートによって提供されます。
QML Value Typesも参照してください 。
© 2025 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.