AbstractRayCaster QML Type
3D 씬에서 광선 캐스팅을 위한 추상 베이스 클래스입니다. 더 보기...
Import Statement: | import Qt3D.Render 2.8 |
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
입니다.
Constant | 설명 |
---|---|
AcceptAnyMatchingLayers | 이 AbstractRayCaster 에 추가된 하나 이상의 Layer 개체를 참조하는 엔티티를 허용합니다. 기본값은 다음과 같습니다. |
AcceptAllMatchingLayers | 여기에 추가된 모든 Layer 개체를 참조하는 엔터티를 허용합니다. AbstractRayCaster |
DiscardAnyMatchingLayers | 여기에 추가된 하나 이상의 Layer 개체를 참조하는 엔터티를 삭제합니다. AbstractRayCaster |
DiscardAllMatchingLayers | 여기에 추가된 모든 Layer 개체를 참조하는 엔티티를 삭제합니다. AbstractRayCaster |
hits : array |
마지막 광선 투사 테스트 결과를 자바스크립트 객체 배열로 보유합니다. 객체에 정의된 필드는 아래에 정의되어 있습니다.
{ 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 |
레이 캐스팅 테스트 수행 빈도를 제어하는 실행 모드를 보유합니다.
Constant | 설명 |
---|---|
Continuous | 컴포넌트가 활성화되어 있는 한 매 프레임마다 레이 캐스팅이 수행됩니다. |
SingleShot | 레이 캐스팅이 한 번 수행되면 컴포넌트가 자체적으로 비활성화됩니다. 기본값은 다음과 같습니다. |
© 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.