이 페이지에서

Qt3DRender::QRayCasterHit Class

class Qt3DRender::QRayCasterHit

모델을 통과하는 광선을 투사할 때 발생하는 히트의 세부 정보. 더 보기...

헤더: #include <qraycasterhit.h>
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::TriangleHit0선택된 프리미티브는 삼각형이었으며, 정점 인덱스는 삼각형을 구성하는 세 점을 가리킵니다.
Qt3DRender::QRayCasterHit::LineHit1선택된 프리미티브가 선분이며, 처음 두 꼭짓점은 해당 선분을 구성하는 두 점을 가리킵니다.
Qt3DRender::QRayCasterHit::PointHit2선택된 프리미티브는 단일 점이었으므로, 3개의 정점 인덱스 모두 정의되지 않습니다
Qt3DRender::QRayCasterHit::EntityHit3오직 경계 볼륨만 고려되었으며, 프리미티브 및 정점 인덱스는 정의되지 않습니다.

속성 설명서

[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

광선의 기점과 교차점 사이의 거리를 반환합니다.

참고: distance 속성에 대한게터 함수입니다.

Qt3DCore::QEntity *QRayCasterHit::entity() const

피격된 엔티티에 대한 포인터를 반환합니다

참고: entity 속성에 대한게터 함수입니다.

Qt3DCore::QNodeId QRayCasterHit::entityId() const

타격받은 엔티티의 ID를 반환합니다.

참고: entityId 속성에 대한게터 함수입니다.

QVector3D QRayCasterHit::localIntersection() const

엔티티의 좌표계에서 교차점의 좌표를 반환합니다.

참고: localIntersection 속성에 대한게터 함수입니다.

uint QRayCasterHit::primitiveIndex() const

선택된 프리미티브의 인덱스를 반환합니다.

참고: primitiveIndex 속성에 대한게터 함수입니다.

Qt3DRender::QRayCasterHit::HitType QRayCasterHit::type() const

히트의 유형을 반환합니다

참고: `type` 속성에 대한게터 함수입니다.

uint QRayCasterHit::vertex1Index() const

선택된 프리미티브의 첫 번째 정점의 인덱스를 반환합니다.

참고: vertex1Index 속성에 대한게터 함수입니다.

uint QRayCasterHit::vertex2Index() const

선택된 프리미티브의 두 번째 정점의 인덱스를 반환합니다.

참고: vertex2Index 속성에 대한게터 함수입니다.

uint QRayCasterHit::vertex3Index() const

선택된 프리미티브의 세 번째 정점의 인덱스를 반환합니다.

참고: vertex3Index 속성에 대한게터 함수입니다.

QVector3D QRayCasterHit::worldIntersection() const

모델 좌표계에서 교차점의 좌표를 반환합니다.

참고: worldIntersection 속성에 대한게터 함수입니다.

© 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.