Qt3DRender::QRayCasterHit Class
class Qt3DRender::QRayCasterHit모델을 통해 광선을 투사할 때 적중의 세부 정보입니다. 더 보기...
| 헤더: | #include <QRayCasterHit> |
| CMake: | find_package(Qt6 REQUIRED COMPONENTS 3drender)target_link_libraries(mytarget PRIVATE Qt6::3drender) |
| qmake: | QT += 3drender |
| 상태: | 폐지됨 |
공용 유형
| enum | HitType { TriangleHit, LineHit, PointHit, EntityHit } |
속성
|
|
공공 기능
| float | distance() const |
| Qt3DCore::QEntity * | entity() const |
| Qt3DCore::QNodeId | entityId() const |
| QVector3D | localIntersection() const |
| uint | primitiveIndex() const |
| Qt3DRender::QRayCasterHit::HitType | type() const |
| uint | vertex1Index() const |
| uint | vertex2Index() const |
| uint | vertex3Index() const |
| QVector3D | worldIntersection() const |
상세 설명
Qt3DRender::QRayCasterHit 에는 Qt3DRender::QRayCaster 또는 Qt3DRender::QScreenRayCaster 컴포넌트를 사용하여 모델을 통해 광선을 투사할 때 성공한 세부 정보가 들어 있습니다.
Qt3DRender::QRayCaster, Qt3DRender::QScreenRayCaster, Qt3DRender::QPickingSettings 를참조하세요 .
멤버 유형 문서
enum QRayCasterHit::HitType
반환된 히트 유형을 지정합니다. QPickingSettings 을 사용하여 제어합니다.
| 상수 | 값 | 설명 |
|---|---|---|
Qt3DRender::QRayCasterHit::TriangleHit | 0 | 선택된 프리미티브는 삼각형이고 꼭지점 인덱스는 삼각형을 구성하는 세 점을 참조합니다. |
Qt3DRender::QRayCasterHit::LineHit | 1 | 선택된 프리미티브는 선분이며, 처음 두 정점은 선을 구성하는 두 점을 참조합니다. |
Qt3DRender::QRayCasterHit::PointHit | 2 | 선택된 프리미티브는 단일 점이며, 3개의 정점 인덱스는 모두 정의되지 않습니다. |
Qt3DRender::QRayCasterHit::EntityHit | 3 | 바운딩 볼륨만 고려되었으며, 프리미티브와 버텍스 인덱스는 정의되지 않습니다. |
프로퍼티 문서
[read-only] distance : const float
이 프로퍼티는 광선의 원점과 교차점 사이의 거리를 보유합니다.
광선 원점에서 광선이 엔티티와 교차하는 지점까지의 거리를 보유합니다.
함수에 액세스합니다:
| float | distance() const |
[read-only] entity : Qt3DCore::QEntity* const
이 프로퍼티는 광선에 맞은 엔티티에 대한 포인터를 보유합니다.
광선에 맞은 QEntity에 대한 포인터를 보유합니다.
함수에 액세스합니다:
| Qt3DCore::QEntity * | entity() const |
[read-only] entityId : const Qt3DCore::QNodeId
이 프로퍼티에는 광선에 맞은 엔티티의 ID가 저장됩니다.
광선에 맞은 엔티티의 노드 ID를 보유합니다.
함수에 액세스합니다:
| Qt3DCore::QNodeId | entityId() const |
[read-only] localIntersection : const QVector3D
이 속성은 엔티티의 좌표계에서 교차점의 좌표를 보유합니다.
엔티티의 로컬 좌표계에서 교차점의 좌표를 보유합니다.
함수에 액세스합니다:
| QVector3D | localIntersection() const |
[read-only] primitiveIndex : const uint
이 프로퍼티는 선택된 프리미티브의 인덱스를 저장합니다.
선택된 프리미티브(삼각형, 선 또는 점)의 인덱스를 보유합니다.
함수에 액세스합니다:
| uint | primitiveIndex() const |
[read-only] type : const QRayCasterHit::HitType
이 속성은 히트 유형을 보유합니다.
TriangleHit, LineHit, PointHit, EntityHit 등 히트 유형을 보유합니다.
함수에 액세스합니다:
| Qt3DRender::QRayCasterHit::HitType | type() const |
[read-only] vertex1Index : const uint
이 프로퍼티는 선택된 프리미티브의 첫 번째 버텍스의 인덱스를 보유합니다.
선택된 프리미티브의 첫 번째 버텍스의 인덱스를 보유합니다. 삼각형이 히트된 경우, 세 개의 정점 중 하나입니다. 선이 히트된 경우 두 정점 중 하나입니다.
함수에 액세스합니다:
| uint | vertex1Index() const |
[read-only] vertex2Index : const uint
이 프로퍼티는 선택된 프리미티브의 두 번째 버텍스의 인덱스를 보유합니다.
선택된 프리미티브의 두 번째 버텍스의 인덱스를 보유합니다. 삼각형이 히트된 경우, 세 개의 정점 중 하나입니다. 선이 히트된 경우 두 정점 중 하나입니다.
함수에 액세스합니다:
| uint | vertex2Index() const |
[read-only] vertex3Index : const uint
이 프로퍼티는 선택된 프리미티브의 세 번째 버텍스의 인덱스를 보유합니다.
선택된 프리미티브의 세 번째 버텍스의 인덱스를 보유합니다. 이 프로퍼티는 삼각형 히트에만 유효합니다.
함수에 액세스합니다:
| uint | vertex3Index() const |
[read-only] worldIntersection : const QVector3D
이 프로퍼티는 모델의 좌표계에서 교차점의 좌표를 보유합니다.
세계 좌표계에서 교차점의 좌표를 보유합니다.
함수에 액세스합니다:
| QVector3D | worldIntersection() const |
멤버 함수 문서
float QRayCasterHit::distance() const
광선의 원점과 교차점 사이의 거리를 반환합니다.
참고: 프로퍼티 거리에 대한 겟터 함수입니다.
Qt3DCore::QEntity *QRayCasterHit::entity() const
히트된 엔티티에 대한 포인터를 반환합니다.
참고: 프로퍼티 엔티티에 대한 겟터 함수입니다.
Qt3DCore::QNodeId QRayCasterHit::entityId() const
히트된 엔티티의 ID를 반환합니다.
참고: entityId 프로퍼티에 대한 겟터 함수입니다.
QVector3D QRayCasterHit::localIntersection() const
엔티티의 좌표계에서 교차점의 좌표를 반환합니다.
참고: localIntersection 프로퍼티에 대한 겟터 함수입니다.
uint QRayCasterHit::primitiveIndex() const
선택된 프리미티브의 인덱스를 반환합니다.
참고: 프리미티브 인덱스 프로퍼티의 겟터 함수입니다.
Qt3DRender::QRayCasterHit::HitType QRayCasterHit::type() const
히트 유형을 반환합니다.
참고: 속성 유형에 대한 겟터 함수입니다.
uint QRayCasterHit::vertex1Index() const
선택된 프리미티브의 첫 번째 버텍스의 인덱스를 반환합니다.
참고: vertex1Index 프로퍼티에 대한 겟터 함수입니다.
uint QRayCasterHit::vertex2Index() const
선택된 프리미티브의 두 번째 버텍스의 인덱스를 반환합니다.
참고: vertex2Index 프로퍼티에 대한 겟터 함수입니다.
uint QRayCasterHit::vertex3Index() const
선택된 프리미티브의 세 번째 버텍스의 인덱스를 반환합니다.
참고: vertex3Index 프로퍼티에 대한 겟터 함수입니다.
QVector3D QRayCasterHit::worldIntersection() const
모델의 좌표계에서 교차점의 좌표를 반환합니다.
참고: 세계 교차점 프로퍼티의 Getter 함수입니다.
© 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.