Unity 2022.3 & Oculus Integration URP 07 (Create Ray Interactions)

VR/Oculus Integration 2023. 9. 21. 17:35
반응형

손이나 컨트롤러에서 객체로 광선을 투사하려면 광선 상호 작용을 사용하십시오.

광선 상호 작용을 생성하려면 손 광선 상호 작용자를 추가하거나(손 또는 컨트롤러를 손으로 사용하는 경우) 컨트롤러 광선 상호 작용자를 추가한 다음(컨트롤러를 사용하는 경우) 광선을 감지할 각 GameObject에 상호 작용 가능한 광선을 추가합니다.

 

To try ray interactions in a pre-built scene, see the RayExamples scene.

 

Before you begin

 

 

 

 

 

 

 

 

빌드후 손이 보이면 성공 준비 완료 

 


Add Ray Interactors

 

Adding Hand Ray Interactors for Hands

  1. Open the Unity scene where you set up your hands.
  2. Under Project, search for HandRayInteractor, and drag the HandRayInteractor prefab from the search results into the Hierarchy onto OVRInteraction > OVRHands > LeftHand > HandInteractorsLeft.

계층 구조에서 HandInteractorsLeft를 선택합니다.

Inspector 아래 Best Hover Interactor Group 구성 요소의 Interactors 목록에서 +를 클릭하여 새 요소를 추가합니다.

 

 

Hierarchy에서 HandRayInteractor를 요소의 속성으로 드래그하여 요소를 HandRayInteractor로 설정합니다.

 

Repeat these steps for the right hand.

 

 

Select File > Build And Run, or if you have an Oculus Link connected, click Play.

 

현재 장면이 로드됩니다. 광선이 가리키는 위치를 나타내기 위해 검지와 엄지 손가락 사이에 작은 아이콘이 나타납니다.
포인터 손가락과 엄지손가락을 함께 터치하면 아이콘이 흰색 선으로 변경되어 개체(있는 경우)를 선택하고 있음을 나타냅니다

 

빌드후 결과 확인

 

 


컨트롤러용 핸드 레이 인터랙터를 손으로 추가

 

 

프로젝트에서 HandRayInteractor를 검색하고 검색

 

결과의 HandRayInteractor 프리팹을 계층 구조의 OVRInteraction > OVRControllerHands > LeftControllerHand > ControllerHandInteractors로 드래그합니다.

 

 

 

  1. Under Hierarchy, select ControllerHandInteractors.
  2. Under Inspector, in the Best Hover Interactor Group component, click the + in the Interactors list to add a new element.
  3. Set the element to HandRayInteractor by dragging HandRayInteractor from Hierarchy to the element’s property.
  4.  

 

  1. Repeat these steps for the right controller hand.

 

 

 

빌드후 결과 확인 

컨트롤러를 쥐고 확인 해보면 댐 

 

 


컨트롤러 레이 인터랙터 추가

Under Project, search for ControllerRayInteractor, and drag the ControllerRayInteractor prefab from the search results into the Hierarchy onto OVRInteraction > OVRControllers > LeftController > ControllerInteractors.

 

  1. Select ControllerInteractors.
  2. Under Inspector, in the Best Hover Interactor Group component, click the + in the Interactors list to add a new element.
  3. Set the element to ControllerRayInteractor.

Repeat these steps for the right controller.

 

빌드후 결과 확인 

현재 장면이 로드됩니다. 각 컨트롤러에서 방출되는 흰색 빔은 각 광선이 가리키는 위치를 나타냅니다. 컨트롤러의 방아쇠를 당기면 광선이 흰색에서 파란색으로 바뀌어 개체(있는 경우)를 선택하고 있음을 나타냅니다.

 

 

컨트롤러가 안보이면 이것을 확인 

 

https://docs.unity3d.com/Packages/com.unity.render-pipelines.universal@7.1/manual/upgrading-your-shaders.html

 

 

 


Add Ray Interactable

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 


참고:https://developer.oculus.com/documentation/unity/unity-isdk-create-ray-interactions/

 

반응형
: