Qt Quick 3D - XR 자유형 순간이동 예제
Qt Quick 3D XR에서 간단한 이동 기능을 구현하는 방법을 시연합니다.

개요
이 예제는 비연속적인 이동 방식인 간단한 자유형 순간이동 시스템을 사용하여 가상 환경 내의 특정 위치로 이동하는 방법을 보여줍니다.
조작법
이동을 위해 오른쪽 컨트롤러의 썸스틱을 사용합니다:
- 스틱을 앞으로 밀면 이동 방향을 지정하고, 손을 떼면 순간이동합니다.
- 스틱을 옆으로 움직이면 회전합니다.
구현
텔레포트 로직은 ` FreeformTeleporter ` 컴포넌트에 구현되어 있습니다.
FreeformTeleporter {
id: teleporter
view: xrView
originNode: xrOrigin
cameraNode: xrOrigin.camera
beamHandle: xrRightController
rotationTriggerValue: xrRightController.xValue
teleportTriggerValue: xrRightController.yValue
onDoTeleportation: (cameraOriginPosition)=> {
xrOrigin.position = cameraOriginPosition
}
onDoRotation: (cameraOriginRotation, cameraOriginPosition)=> {
xrOrigin.rotation = cameraOriginRotation
xrOrigin.position = cameraOriginPosition
}
}FreeformTeleporter 컴포넌트에는 다음과 같이 설정해야 할 속성이 있습니다:
QtObject xrViewxrView 속성을 통해 XrView 의 내장 레이 피킹 기능을 사용할 수 있습니다. rayPick 메서드를 구현하는 모든 객체를 사용할 수 있습니다. 예를 들어, View3D 는 프로토타이핑에 유용할 수 있습니다.
Node originNodeoriginNode 속성은 프리폼 텔레포터가 조작할 노드를 지정합니다. XR에서는 XrOrigin 을 이동시켜 인공 이동을 수행합니다. 따라서 XrView 의 xrOrigin을 originNode 로 사용할 것입니다.
Node cameraNodecameraNode 속성은 카메라의 위치를 제공합니다. 회전 시에는 회전 중심을 정의하며, 텔레포팅 시에는 선택한 위치 위에 배치될 위치를 정의합니다. 이 예제에서는 앞서 생성한 추적된 XrCamera 를 사용합니다.
참고: XR에서 ` XrOrigin `는 씬과 사용자의 기준 공간 간의 관계를 정의합니다. 이 기준 공간은 일반적으로 사용자 주변의 물리적 공간에 고정되어 있습니다. XrOrigin 의 위치를 변경하면 물리적 위치가 씬 좌표에 매핑되는 방식이 변경됩니다. XrCamera 는 사용자의 머리 위치를 추적합니다. 사용자가 물리적으로 이동하면, XrCamera 의 위치와 방향은 XrOrigin 에 상대적으로 변경됩니다.
Node beamHandlebeamHandle 속성은 순간이동 빔의 시작점으로 사용되는 노드입니다. 이 예제에서는 오른쪽 컨트롤러를 beamHandle로 사용합니다.
Qt Quick 3D Xr의 이동 방식도 참조하십시오 .
© 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.