void Update() { if (NoloVR_Playform.GetInstance().GetPlayformError() != NoloError.None) { return; } if (showTrackingBoundary == false) { return; } var pose = NoloVR_Controller.GetDevice(NoloDeviceType.BaseStation).GetPose(); transform.localPosition = pose.pos; transform.localRotation = pose.rot; for (int i = 0; i < NoloVR_System.GetInstance().objects.Length; i++) { if (Mathf.Abs(NoloVR_System.GetInstance().objects[i].transform.localPosition.x) > Mathf.Abs(transform.position.z - NoloVR_System.GetInstance().objects[i].transform.localPosition.z) || Mathf.Abs(NoloVR_System.GetInstance().objects[i].transform.localPosition.y - transform.position.y) > Mathf.Abs(transform.position.z - NoloVR_System.GetInstance().objects[i].transform.localPosition.z + 0.1f)) { NOLO_Events.Send(NOLO_Events.EventsType.TrackingOutofRange); break; } else { NOLO_Events.Send(NOLO_Events.EventsType.TrackingInRange); } } }
//HapticPulse parameter must be in 0~100 public void TriggerHapticPulse(int intensity) { if (NoloVR_Playform.GetInstance().GetPlayformError() == NoloError.None) { NoloVR_Playform.GetInstance().TriggerHapticPulse(index, intensity); } }
public void Update() { if (Time.frameCount != preFrame) { preFrame = Time.frameCount; preControllerStates = controllerStates; if (NoloVR_Playform.GetInstance().GetPlayformError() == NoloError.None && NoloVR_Playform.GetInstance().GetAuthentication()) { controllerStates = NoloVR_Plugins.GetControllerStates(index); if (isTurnAround) { if (NoloVR_Controller.recPosition == Vector3.zero) { NoloVR_Controller.recPosition = NoloVR_Plugins.GetPose(0).pos; } pose = NoloVR_Plugins.GetPose(index); var rot = pose.rot.eulerAngles; rot += new Vector3(0, 180, 0); pose.rot = Quaternion.Euler(rot); pose.pos.x = NoloVR_Controller.recPosition.x * 2 - pose.pos.x; pose.pos.z = NoloVR_Controller.recPosition.z * 2 - pose.pos.z; pose.vecVelocity.x = -pose.vecVelocity.x; pose.vecVelocity.z = -pose.vecVelocity.z; return; } NoloVR_Controller.recPosition = Vector3.zero; pose = NoloVR_Plugins.GetPose(index); } } }
private void Update() { if (NoloVR_Playform.GetInstance().GetPlayformError() != NoloError.None) { return; } UpdatePose(); }
#pragma warning disable IDE0051 // 删除未使用的私有成员 private void Update() #pragma warning restore IDE0051 // 删除未使用的私有成员 { if (NoloVR_Playform.GetInstance().GetPlayformError() != NoloError.None) { return; } UpdatePose(); }
public void Update() { if (Time.frameCount != preFrame) { preFrame = Time.frameCount; preControllerStates = controllerStates; if (NoloVR_Playform.GetInstance().GetPlayformError() == NoloError.None && NoloVR_Playform.GetInstance().GetAuthentication()) { controllerStates = NoloVR_Plugins.GetControllerStates(index); electricity = NoloVR_Plugins.GetElectricity(index); connectStatus = NoloVR_Plugins.GetNoloConnectStatus(index); float yaw = real_yaw * 57.3f; pose = NoloVR_Plugins.GetPose(index); if (index == 0) { //pose.pos += pose.rot * new Vector3(0, 0.08f, 0.062f); pose.rot = Quaternion.Euler(new Vector3(0, -yaw, 0)); //pose.pos -= pose.rot * new Vector3(0, 0.08f, 0.062f); } if (isTurnAround) { if (NoloVR_Controller.recPosition == Vector3.zero) { NoloVR_Controller.recPosition = NoloVR_Plugins.GetPose(0).pos; } var rot = pose.rot.eulerAngles; rot += new Vector3(0, 180 + yaw, 0); pose.rot = Quaternion.Euler(rot); Vector3 revec = Quaternion.Euler(new Vector3(0, 180 + yaw, 0)) * pose.pos + NoloVR_Controller.recPosition; pose.pos.x = revec.x; pose.pos.z = revec.z; pose.vecVelocity.x = -pose.vecVelocity.x; pose.vecVelocity.z = -pose.vecVelocity.z; return; } } if (NoloVR_System.GetInstance().realTrackDevices != 3 && NoloVR_System.GetInstance().realTrackDevices != 6) { NoloVR_System.GetInstance().realTrackDevices = NoloVR_Plugins.GetTrackModel(); } } }
void OnApplicationQuit() { //close connect from device Debug.Log("Nolo debug:Application quit"); NoloVR_Playform.GetInstance().DisconnectDevice(); }
private void Start() { NoloVR_Playform.GetInstance().Authentication(appKey); }
void Start() { NoloVR_Playform.GetInstance().Authentication(appKey); NoloVR_Playform.GetInstance().SetHmdTrackingCenter((int)VRPlayform); }