AbstractRayCaster QML Type
3Dシーンにおけるレイキャスティングのための抽象基底クラス。詳細...
| Import Statement: | import Qt3D.Render 2.12 |
| In C++: | QAbstractRayCaster |
| Status: | Deprecated |
この型は非推奨です。新しいコードでの使用は強く推奨しません。
プロパティ
- filterMode : enumeration
- hits : array
- runMode : enumeration
詳細な説明
AbstractRayCaster は、3D シーン内にレイをキャストするための抽象基底クラスです。 AbstractRayCasterは直接インスタンス化することはできず、そのサブクラスを通じてインスタンス化されます。QAbstractRayCasterは、実行モードやレイヤーの処理など、すべてのレイキャスターに共通するプロパティを規定し、実際のレイキャスティングの詳細はサブクラスに委ねています。
レイキャスティングは、ObjectPicker を使用したピッキングとは異なり、トリガーにマウスイベントを必要としません。
デフォルトでは、AbstractRayCasterのインスタンスは無効になっています。有効にすると、指定されたレイについて、毎フレームごとにオブジェクトとの交差がチェックされます。オブジェクトが見つからなかった場合でも、レイキャスティングの結果がAbstractRayCaster.hitsプロパティに反映されます。
Qt3D.Render::PickingSettings を使用すると、どのプリミティブをテストするか、結果をどのように返すかなど、レイキャスティングを制御できます。
さらに、Qt3D.Render::Layer コンポーネントを使用すると、エンティティやエンティティのサブグラフがレイキャスティングにどのように反応するかを制御できます。
注:AbstractRayCaster から派生したコンポーネントは、複数のエンティティ間で共有すべきではありません。
関連項目: Qt3D.Render::RayCaster 、Qt3D.Render::ScreenRayCaster 、Qt3D.Render::ObjectPicker 、Qt3D.Render::PickingSettings 、およびQt3D.Render::NoPicking 。
プロパティのドキュメント
filterMode : enumeration
レイキャスティングテストの対象となるエンティティを指定するフィルタモードを保持します。
デフォルト値はAbstractRayCaster.AcceptMatchingLayers です。
| 定数 | 説明 |
|---|---|
AcceptAnyMatchingLayers | このAbstractRayCaster に追加された1つ以上のLayer オブジェクトを参照するエンティティを受け入れます。これがデフォルトです。 |
AcceptAllMatchingLayers | この に追加されたすべてのLayer オブジェクトを参照するエンティティを受け入れます。これがデフォルトです。AbstractRayCaster |
DiscardAnyMatchingLayers | この に追加された 1 つ以上のLayer オブジェクトを参照するエンティティを受け入れます。これがデフォルトです。この に追加されたすべての オブジェクトを参照するエンティティを受け入れます。AbstractRayCaster |
DiscardAllMatchingLayers | この に追加されたすべてのLayer オブジェクトを参照するエンティティを破棄するAbstractRayCaster |
hits : array [read-only]
前回のレイキャスティングテストの結果を、JavaScript オブジェクトの配列として保持します。オブジェクトに定義されているフィールドについては、以下で説明します。
{
type // enum value of RayCasterHit.HitType
entity // entity that was intersected
distance // distance from ray origin to intersection
localIntersection.x: // coordinate of intersection in the entity's coordinate system
localIntersection.y
localIntersection.z
worldIntersection.x // coordinate of intersection in the model's coordinate system
worldIntersection.y
worldIntersection.z
primitiveIndex // index of the primitive (triangle, line, point) that was intersected;
// (undefined if the picking mode is set to bounding volume)
vertex1Index // index of the first point of the triangle or line that was intersected
// (undefined if the picking mode is set to bounding volume or points)
vertex2Index // index of the second point of the triangle or line that was intersected
// (undefined if the picking mode is set to bounding volume or points)
vertex3Index // index of the second point of the triangle that was intersected
// (undefined if the picking mode is set to bounding volume, points or lines)
}なお、連続するテストでまったく同じ結果(または空の結果)が返された場合でも、テストが行われるたびに変更通知が発行されます。
runMode : enumeration
レイキャスティングのテストが実行される頻度を制御する実行モードを保持します。
| 定数 | 説明 |
|---|---|
Continuous | コンポーネントが有効になっている限り、レイキャスティングは毎フレーム実行されます。 |
SingleShot | レイキャスティングは一度実行された後、コンポーネントは自動的に無効化されます。これがデフォルトの設定です。 |
© 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.