void Start() { foreach (NoloVR_TrackedDevice item in NoloVR_Manager.GetInstance().objects) { if (item.deviceType == NoloDeviceType.LeftController) { leftController = item.gameObject.transform; } if (item.deviceType == NoloDeviceType.RightController) { rightController = item.gameObject.transform; } } controllerCenter = new GameObject("controllerCenter"); }
void Update() { //按下touchpad if (NoloVR_Controller.GetDevice(deviceType).GetNoloButtonPressed(NoloButtonID.TouchPad)) //if (true) { PointerActivate(true); var jointPosition = ProjectForwardBeam(); downPosition = ProjectDownBeam(jointPosition); DisplayCurvedBeam(jointPosition, downPosition); SetPointerCursor(downPosition); } if (NoloVR_Controller.GetDevice(deviceType).GetNoloButtonUp(NoloButtonID.TouchPad)) { if (pointerContactTarget != null) { NoloVR_Manager.GetInstance().transform.position = downPosition - new Vector3(NoloVR_Controller.GetDevice(NoloDeviceType.Hmd).GetPose().pos.x, 0, NoloVR_Controller.GetDevice(NoloDeviceType.Hmd).GetPose().pos.z); } PointerActivate(false); } }
void Update() { if (NoloVR_Playform.InitPlayform().GetPlayformError() != NoloError.None) { return; } transform.localPosition = new Vector3(0, -NoloVR_Plugins.GetHmdInitPosition().y, 0); //y - play ground height for (int i = 0; i < NoloVR_Manager.GetInstance().objects.Length; i++) { if (Mathf.Abs(NoloVR_Manager.GetInstance().objects[i].transform.localPosition.x) > Mathf.Abs(NoloVR_Manager.GetInstance().objects[i].transform.localPosition.z) || Mathf.Abs(NoloVR_Manager.GetInstance().objects[i].transform.localPosition.y - transform.position.y) > Mathf.Abs(NoloVR_Manager.GetInstance().objects[i].transform.localPosition.z) + 0.1f) { NOLO_Events.Send(NOLO_Events.EventsType.TrackingOutofRange); break; } else { NOLO_Events.Send(NOLO_Events.EventsType.TrackingInRange); } } }
void Start() { vrCamera = NoloVR_Manager.GetInstance().VRCamera; }
void Start() { //get vrcamera vrCamera = NoloVR_Manager.GetInstance().VRCamera; }