이 페이지에서

AbstractRayCaster QML Type

3D 장면에서 레이 캐스팅을 위한 추상 기본 클래스입니다. 더 보기...

Import Statement: import Qt3D.Render 2.12
In C++: QAbstractRayCaster
Status: Deprecated

이 유형은 더 이상 사용되지 않습니다. 새로운 코드에서는 이 유형을 사용하지 않도록 강력히 권장합니다.

속성

상세 설명

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`에 추가된 하나 이상의 ` Layer ` 객체를 참조하는 엔티티를 허용합니다. 이 값이 기본값입니다.
AcceptAllMatchingLayers이 에 추가된 모든 Layer 객체를 참조하는 엔티티를 수락합니다. 이것이 기본값입니다. AbstractRayCaster
DiscardAnyMatchingLayers이 에 추가된 하나 이상의 Layer 객체를 참조하는 엔티티를 허용합니다. 이것이 기본값입니다.이 에 추가된 모든 객체를 참조하는 엔티티를 허용합니다. AbstractRayCaster
DiscardAllMatchingLayers이 에 추가된 모든 Layer 객체를 참조하는 엔티티는 제외합니다. AbstractRayCaster

hits : array [read-only]

마지막 레이 캐스팅 테스트 결과를 자바스크립트 객체 배열로 저장합니다. 객체에 정의된 필드는 아래와 같습니다.

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