Attractor3D QML Type
粒子を特定の位置や形状に向かって引き寄せます。詳細...
| Import Statement: | import QtQuick3D.Particles3D |
| Since: | Qt 6.2 |
| Inherits: |
プロパティ
- duration : int
- durationVariation : int
- hideAtEnd : bool
- positionVariation : vector3d
- positionsAmount : int
- shape : ParticleAbstractShape3D
- useCachedPositions : bool
詳細説明
この要素は、3Dビュー内の特定の位置に向かって粒子を引き寄せます。重心が遠くにある質量の大きな物体の重力をモデル化するには、Gravity3D を使用します。
引力位置は、position およびpositionVariation 、あるいはshape のいずれかで定義されます。両方が定義されている場合は、shape が使用されます。
プロパティのドキュメント
duration : int
このプロパティは、パーティクルが引力位置に到達するまでの時間をミリ秒単位で定義します。値が -1 の場合、パーティクルのライフスパンがその時間として使用されます。
デフォルト値は-1 です。
durationVariation : int
このプロパティは、持続時間の変動をミリ秒単位で定義します。アトラクタに到達するまでの実際の持続時間は、duration ~durationVariation およびduration ~durationVariation の範囲内となります。
デフォルト値は0 (変動なし)です。
hideAtEnd : bool
このプロパティは、パーティクルがアトラクタに到達した際に消えるかどうかを定義します。
デフォルト値はfalse です。
positionVariation : vector3d
このプロパティは、吸引位置の変動を定義します。これにより、単一の点ではなく、より広い範囲に向かってランダムに粒子を引き寄せることができます。 以下は、座標 (100, 0, 0) にある (50, 50, 50) の立方体内のランダムな点へ、2~4秒かけて粒子を引き寄せる例です:
Attractor3D {
position: Qt.vector3d(100, 0, 0)
positionVariation: Qt.vector3d(50, 50, 50)
duration: 3000
durationVariation: 1000
}デフォルト値は(0, 0, 0) (変動なし)です。
「 Node::position 」および「shape 」も参照してください 。
positionsAmount : int
このプロパティは、アトラクタの形状内に保存される可能な位置の数を定義します。デフォルトでは、この数はパーティクルの数と等しくなりますが、キャッシュを小さくするにはこの数を小さく設定できます。また、ランダム性を高めるには、この数を大きく設定することもできます。
shape : ParticleAbstractShape3D
このプロパティは、パーティクルの引力作用のための「ParticleAbstractShape3D 」を定義します。各パーティクルは、この形状内のランダムな位置に引き寄せられます。これは、position およびpositionVariation を定義する代替手段となります。以下は、パーティクルの先端(lifeSpan )を用いて、球体内のランダムな点にパーティクルを引き寄せる例です:
Attractor3D {
position: Qt.vector3d(100, 0, 0)
shape: ParticleShape3D {
type: ParticleShape3D.Sphere
fill: true
}
}Node::position およびpositionVariationも参照してください 。
useCachedPositions : bool
このプロパティは、アトラクタがその形状内の可能な位置をキャッシュするかどうかを定義します。位置をキャッシュすると、ランダム性は低くなりますが、パフォーマンスは向上します。
デフォルト値はtrue です。
© 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.