Qt Quick 3D - XR 자유형 순간이동 예제

Qt Quick 3D XR에서 간단한 이동을 만드는 방법을 시연합니다.

개요

이 예제는 비연속적인 이동 형태인 간단한 자유형 순간이동 시스템을 사용하여 가상 환경의 장소로 이동하는 방법을 보여줍니다.

컨트롤

예제를 실행할 때 다음 컨트롤을 사용하여 탐색합니다.

액션컨트롤
회전오른쪽 컨트롤러의 왼쪽 및 오른쪽 스틱
조준 및 텔레포트오른쪽 컨트롤러의 앞으로 스틱

구현

모든 로직이 해당 유형에 포함되어 있으므로 다른 프로젝트에서 FreeformTeleporter 를 쉽게 재사용할 수 있습니다.

FreeformTeleporter {
    id: teleporter

    rayPicker: xrView
    cameraOrigin: xrOrigin
    camera: xrOrigin.camera
    beamHandle: xrRightController
    onDoTeleportation: (cameraOriginPosition)=> {
                           xrOrigin.position = cameraOriginPosition
                       }
    onDoRotation: (cameraOriginRotation, cameraOriginPosition)=> {
                      xrOrigin.rotation = cameraOriginRotation
                      xrOrigin.position = cameraOriginPosition
                  }
}

프리폼 텔레포터 컴포넌트에는 설정해야 하는 프로퍼티가 다음과 같습니다:

var rayPicker

rayPicker 속성은 레이픽 메서드를 구현하는 모든 객체가 될 수 있습니다. 이 예시에서는 XrView 의 내장된 광선 선택 메서드를 사용하고 있습니다.

Node cameraOrigin

cameraOrigin 속성은 카메라의 로컬 참조 공간의 중심입니다. Xr에서는 카메라와 같은 추적된 아이템이 상대적으로 배치되는 위치가 됩니다. 따라서 XrOrigin 노드를 카메라 오리진으로 사용합니다.

Node camera

camera 속성에는 씬을 렌더링하는 데 사용되는 카메라가 포함됩니다. 이 예제에서는 앞서 만든 XrCamera 추적된 노드를 사용합니다.

Node beamHandle

beamHandle 속성은 텔레포트 빔의 시작점으로 사용되는 노드입니다. 이 예제에서는 오른쪽 컨트롤러 xrRightController 를 빔 핸들로 사용합니다.

예제 프로젝트 @ code.qt.io

Qt Quick 3D Xr의 로코모션도참조하세요 .

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